﻿using System;
using System.Collections;
using System.Data;
using System.Data.OleDb;
using System.Windows.Forms;
using C1.Win.C1TrueDBGrid;
using PCSComProduct.Items.BO;
using PCSComProduct.Items.DS;
using PCSComProduction.WorkOrder.BO;
using PCSComUtils.Common;
using PCSComUtils.Common.BO;
using PCSComUtils.MasterSetup.BO;
using PCSComUtils.MasterSetup.DS;
using PCSComUtils.PCSExc;
using PCSUtils.Log;
using PCSUtils.Utils;
using PCSComUtils.DataContext;

namespace PCSProduction.WorkOrder
{
	/// <summary>
	/// Summary description for WOBOM.
	/// </summary>
	public class WOBOM : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnHelp;
		private System.Windows.Forms.Button btnDelete;
		private System.Windows.Forms.Button btnSave;
		private System.Windows.Forms.Button btnEdit;
		private System.Windows.Forms.Button btnOK;
		private System.Windows.Forms.Label lblLable1;
		private System.Windows.Forms.Label lblRevision;
		private System.Windows.Forms.TextBox txtItemCode;
		private C1.Win.C1List.C1Combo cboCCN;
		private System.Windows.Forms.TextBox txtBOMDes;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		
		private const string THIS = "PCSProduction.WorkOrder.WOBOM";

		private string StockUMCode = "StockCode";
		private string WorkCenterCode = "WorkCenterCode";
		private string CaptionLine = "Line";
		private string CaptionOperation = "Operation";

		private C1.Win.C1TrueDBGrid.C1TrueDBGrid dgrdData;
		private System.Windows.Forms.TextBox txtModel;
		private System.Windows.Forms.TextBox txtPartName;
		private C1.Win.C1Input.C1NumericEdit txtIncrement;
		private System.Windows.Forms.TextBox txtWorkCenter;
		private System.Windows.Forms.Label lblWorkcenter;
		private System.Windows.Forms.TextBox txtFGoodsCode;
		private System.Windows.Forms.Label lblFGoodsCode;
		private System.Windows.Forms.TextBox txtWOMaster;
		private System.Windows.Forms.Label lblWOMaster;
		private const string DECIMAL_NUMBERFORMAT_SMALL = "##############,0.00000";

		private DataSet dstBOMDetail = new DataSet();
		ITM_ProductVO voProduct = new ITM_ProductVO();
		WOBOMBO boWOBOM = new WOBOMBO();
		private DataTable dtbGridLayout;
		private EnumAction enumAction = EnumAction.Default;
		private bool blnHasError = false;
		private bool blnIsChange = false;
		/// <summary>
		/// Change bom
		/// </summary>
		public bool ChangeBom
		{
			set {blnIsChange = value;}
		}
		private System.Windows.Forms.Label lblDescription;
		private System.Windows.Forms.Label lblCode;
		private System.Windows.Forms.Label lblComment;
		private System.Windows.Forms.Label lblIncreament;
		private int intWOLineStatus =0;
		
		public WOBOM()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
		}

		public WOBOM(string pstrFGoodsCode, int pintWODetailID, int pintStatus, int pintWOMasterID, string pstrWOCode, int pintProductID)
		{
			InitializeComponent();

			txtFGoodsCode.Text = pstrFGoodsCode;
			txtFGoodsCode.Tag = pintWODetailID;
			intWOLineStatus = pintStatus;
			txtWOMaster.Text = pstrWOCode;
			txtWOMaster.Tag = pintWOMasterID;
			txtItemCode.Tag = voProduct.ProductID = pintProductID;
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(WOBOM));
			this.btnEdit = new System.Windows.Forms.Button();
			this.btnOK = new System.Windows.Forms.Button();
			this.btnHelp = new System.Windows.Forms.Button();
			this.btnDelete = new System.Windows.Forms.Button();
			this.btnSave = new System.Windows.Forms.Button();
			this.dgrdData = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
			this.cboCCN = new C1.Win.C1List.C1Combo();
			this.lblLable1 = new System.Windows.Forms.Label();
			this.lblRevision = new System.Windows.Forms.Label();
			this.lblDescription = new System.Windows.Forms.Label();
			this.lblCode = new System.Windows.Forms.Label();
			this.lblComment = new System.Windows.Forms.Label();
			this.lblIncreament = new System.Windows.Forms.Label();
			this.txtItemCode = new System.Windows.Forms.TextBox();
			this.txtBOMDes = new System.Windows.Forms.TextBox();
			this.txtModel = new System.Windows.Forms.TextBox();
			this.txtPartName = new System.Windows.Forms.TextBox();
			this.txtIncrement = new C1.Win.C1Input.C1NumericEdit();
			this.txtWorkCenter = new System.Windows.Forms.TextBox();
			this.lblWorkcenter = new System.Windows.Forms.Label();
			this.txtFGoodsCode = new System.Windows.Forms.TextBox();
			this.lblFGoodsCode = new System.Windows.Forms.Label();
			this.txtWOMaster = new System.Windows.Forms.TextBox();
			this.lblWOMaster = new System.Windows.Forms.Label();
			((System.ComponentModel.ISupportInitialize)(this.dgrdData)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.txtIncrement)).BeginInit();
			this.SuspendLayout();
			// 
			// btnEdit
			// 
			this.btnEdit.AccessibleDescription = resources.GetString("btnEdit.AccessibleDescription");
			this.btnEdit.AccessibleName = resources.GetString("btnEdit.AccessibleName");
			this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnEdit.Anchor")));
			this.btnEdit.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnEdit.BackgroundImage")));
			this.btnEdit.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnEdit.Dock")));
			this.btnEdit.Enabled = ((bool)(resources.GetObject("btnEdit.Enabled")));
			this.btnEdit.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnEdit.FlatStyle")));
			this.btnEdit.Font = ((System.Drawing.Font)(resources.GetObject("btnEdit.Font")));
			this.btnEdit.Image = ((System.Drawing.Image)(resources.GetObject("btnEdit.Image")));
			this.btnEdit.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.ImageAlign")));
			this.btnEdit.ImageIndex = ((int)(resources.GetObject("btnEdit.ImageIndex")));
			this.btnEdit.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnEdit.ImeMode")));
			this.btnEdit.Location = ((System.Drawing.Point)(resources.GetObject("btnEdit.Location")));
			this.btnEdit.Name = "btnEdit";
			this.btnEdit.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnEdit.RightToLeft")));
			this.btnEdit.Size = ((System.Drawing.Size)(resources.GetObject("btnEdit.Size")));
			this.btnEdit.TabIndex = ((int)(resources.GetObject("btnEdit.TabIndex")));
			this.btnEdit.Text = resources.GetString("btnEdit.Text");
			this.btnEdit.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnEdit.TextAlign")));
			this.btnEdit.Visible = ((bool)(resources.GetObject("btnEdit.Visible")));
			this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
			// 
			// btnOK
			// 
			this.btnOK.AccessibleDescription = resources.GetString("btnOK.AccessibleDescription");
			this.btnOK.AccessibleName = resources.GetString("btnOK.AccessibleName");
			this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnOK.Anchor")));
			this.btnOK.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOK.BackgroundImage")));
			this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
			this.btnOK.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnOK.Dock")));
			this.btnOK.Enabled = ((bool)(resources.GetObject("btnOK.Enabled")));
			this.btnOK.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnOK.FlatStyle")));
			this.btnOK.Font = ((System.Drawing.Font)(resources.GetObject("btnOK.Font")));
			this.btnOK.Image = ((System.Drawing.Image)(resources.GetObject("btnOK.Image")));
			this.btnOK.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOK.ImageAlign")));
			this.btnOK.ImageIndex = ((int)(resources.GetObject("btnOK.ImageIndex")));
			this.btnOK.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnOK.ImeMode")));
			this.btnOK.Location = ((System.Drawing.Point)(resources.GetObject("btnOK.Location")));
			this.btnOK.Name = "btnOK";
			this.btnOK.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnOK.RightToLeft")));
			this.btnOK.Size = ((System.Drawing.Size)(resources.GetObject("btnOK.Size")));
			this.btnOK.TabIndex = ((int)(resources.GetObject("btnOK.TabIndex")));
			this.btnOK.Text = resources.GetString("btnOK.Text");
			this.btnOK.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOK.TextAlign")));
			this.btnOK.Visible = ((bool)(resources.GetObject("btnOK.Visible")));
			this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
			// 
			// btnHelp
			// 
			this.btnHelp.AccessibleDescription = resources.GetString("btnHelp.AccessibleDescription");
			this.btnHelp.AccessibleName = resources.GetString("btnHelp.AccessibleName");
			this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnHelp.Anchor")));
			this.btnHelp.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnHelp.BackgroundImage")));
			this.btnHelp.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnHelp.Dock")));
			this.btnHelp.Enabled = ((bool)(resources.GetObject("btnHelp.Enabled")));
			this.btnHelp.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnHelp.FlatStyle")));
			this.btnHelp.Font = ((System.Drawing.Font)(resources.GetObject("btnHelp.Font")));
			this.btnHelp.Image = ((System.Drawing.Image)(resources.GetObject("btnHelp.Image")));
			this.btnHelp.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.ImageAlign")));
			this.btnHelp.ImageIndex = ((int)(resources.GetObject("btnHelp.ImageIndex")));
			this.btnHelp.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnHelp.ImeMode")));
			this.btnHelp.Location = ((System.Drawing.Point)(resources.GetObject("btnHelp.Location")));
			this.btnHelp.Name = "btnHelp";
			this.btnHelp.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnHelp.RightToLeft")));
			this.btnHelp.Size = ((System.Drawing.Size)(resources.GetObject("btnHelp.Size")));
			this.btnHelp.TabIndex = ((int)(resources.GetObject("btnHelp.TabIndex")));
			this.btnHelp.Text = resources.GetString("btnHelp.Text");
			this.btnHelp.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnHelp.TextAlign")));
			this.btnHelp.Visible = ((bool)(resources.GetObject("btnHelp.Visible")));
			// 
			// btnDelete
			// 
			this.btnDelete.AccessibleDescription = resources.GetString("btnDelete.AccessibleDescription");
			this.btnDelete.AccessibleName = resources.GetString("btnDelete.AccessibleName");
			this.btnDelete.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnDelete.Anchor")));
			this.btnDelete.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnDelete.BackgroundImage")));
			this.btnDelete.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnDelete.Dock")));
			this.btnDelete.Enabled = ((bool)(resources.GetObject("btnDelete.Enabled")));
			this.btnDelete.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnDelete.FlatStyle")));
			this.btnDelete.Font = ((System.Drawing.Font)(resources.GetObject("btnDelete.Font")));
			this.btnDelete.Image = ((System.Drawing.Image)(resources.GetObject("btnDelete.Image")));
			this.btnDelete.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.ImageAlign")));
			this.btnDelete.ImageIndex = ((int)(resources.GetObject("btnDelete.ImageIndex")));
			this.btnDelete.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnDelete.ImeMode")));
			this.btnDelete.Location = ((System.Drawing.Point)(resources.GetObject("btnDelete.Location")));
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnDelete.RightToLeft")));
			this.btnDelete.Size = ((System.Drawing.Size)(resources.GetObject("btnDelete.Size")));
			this.btnDelete.TabIndex = ((int)(resources.GetObject("btnDelete.TabIndex")));
			this.btnDelete.Text = resources.GetString("btnDelete.Text");
			this.btnDelete.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnDelete.TextAlign")));
			this.btnDelete.Visible = ((bool)(resources.GetObject("btnDelete.Visible")));
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// btnSave
			// 
			this.btnSave.AccessibleDescription = resources.GetString("btnSave.AccessibleDescription");
			this.btnSave.AccessibleName = resources.GetString("btnSave.AccessibleName");
			this.btnSave.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnSave.Anchor")));
			this.btnSave.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnSave.BackgroundImage")));
			this.btnSave.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnSave.Dock")));
			this.btnSave.Enabled = ((bool)(resources.GetObject("btnSave.Enabled")));
			this.btnSave.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnSave.FlatStyle")));
			this.btnSave.Font = ((System.Drawing.Font)(resources.GetObject("btnSave.Font")));
			this.btnSave.Image = ((System.Drawing.Image)(resources.GetObject("btnSave.Image")));
			this.btnSave.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.ImageAlign")));
			this.btnSave.ImageIndex = ((int)(resources.GetObject("btnSave.ImageIndex")));
			this.btnSave.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnSave.ImeMode")));
			this.btnSave.Location = ((System.Drawing.Point)(resources.GetObject("btnSave.Location")));
			this.btnSave.Name = "btnSave";
			this.btnSave.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnSave.RightToLeft")));
			this.btnSave.Size = ((System.Drawing.Size)(resources.GetObject("btnSave.Size")));
			this.btnSave.TabIndex = ((int)(resources.GetObject("btnSave.TabIndex")));
			this.btnSave.Text = resources.GetString("btnSave.Text");
			this.btnSave.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnSave.TextAlign")));
			this.btnSave.Visible = ((bool)(resources.GetObject("btnSave.Visible")));
			this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
			// 
			// dgrdData
			// 
			this.dgrdData.AccessibleDescription = resources.GetString("dgrdData.AccessibleDescription");
			this.dgrdData.AccessibleName = resources.GetString("dgrdData.AccessibleName");
			this.dgrdData.AllowAddNew = ((bool)(resources.GetObject("dgrdData.AllowAddNew")));
			this.dgrdData.AllowArrows = ((bool)(resources.GetObject("dgrdData.AllowArrows")));
			this.dgrdData.AllowColMove = ((bool)(resources.GetObject("dgrdData.AllowColMove")));
			this.dgrdData.AllowColSelect = ((bool)(resources.GetObject("dgrdData.AllowColSelect")));
			this.dgrdData.AllowDelete = ((bool)(resources.GetObject("dgrdData.AllowDelete")));
			this.dgrdData.AllowDrag = ((bool)(resources.GetObject("dgrdData.AllowDrag")));
			this.dgrdData.AllowFilter = ((bool)(resources.GetObject("dgrdData.AllowFilter")));
			this.dgrdData.AllowHorizontalSplit = ((bool)(resources.GetObject("dgrdData.AllowHorizontalSplit")));
			this.dgrdData.AllowRowSelect = ((bool)(resources.GetObject("dgrdData.AllowRowSelect")));
			this.dgrdData.AllowSort = ((bool)(resources.GetObject("dgrdData.AllowSort")));
			this.dgrdData.AllowUpdate = ((bool)(resources.GetObject("dgrdData.AllowUpdate")));
			this.dgrdData.AllowUpdateOnBlur = ((bool)(resources.GetObject("dgrdData.AllowUpdateOnBlur")));
			this.dgrdData.AllowVerticalSplit = ((bool)(resources.GetObject("dgrdData.AllowVerticalSplit")));
			this.dgrdData.AlternatingRows = ((bool)(resources.GetObject("dgrdData.AlternatingRows")));
			this.dgrdData.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("dgrdData.Anchor")));
			this.dgrdData.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("dgrdData.BackgroundImage")));
			this.dgrdData.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("dgrdData.BorderStyle")));
			this.dgrdData.Caption = resources.GetString("dgrdData.Caption");
			this.dgrdData.CaptionHeight = ((int)(resources.GetObject("dgrdData.CaptionHeight")));
			this.dgrdData.CellTipsDelay = ((int)(resources.GetObject("dgrdData.CellTipsDelay")));
			this.dgrdData.CellTipsWidth = ((int)(resources.GetObject("dgrdData.CellTipsWidth")));
			this.dgrdData.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("dgrdData.ChildGrid")));
			this.dgrdData.CollapseColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.CollapseColor")));
			this.dgrdData.ColumnFooters = ((bool)(resources.GetObject("dgrdData.ColumnFooters")));
			this.dgrdData.ColumnHeaders = ((bool)(resources.GetObject("dgrdData.ColumnHeaders")));
			this.dgrdData.DefColWidth = ((int)(resources.GetObject("dgrdData.DefColWidth")));
			this.dgrdData.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("dgrdData.Dock")));
			this.dgrdData.EditDropDown = ((bool)(resources.GetObject("dgrdData.EditDropDown")));
			this.dgrdData.EmptyRows = ((bool)(resources.GetObject("dgrdData.EmptyRows")));
			this.dgrdData.Enabled = ((bool)(resources.GetObject("dgrdData.Enabled")));
			this.dgrdData.ExpandColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.ExpandColor")));
			this.dgrdData.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("dgrdData.ExposeCellMode")));
			this.dgrdData.ExtendRightColumn = ((bool)(resources.GetObject("dgrdData.ExtendRightColumn")));
			this.dgrdData.FetchRowStyles = ((bool)(resources.GetObject("dgrdData.FetchRowStyles")));
			this.dgrdData.FilterBar = ((bool)(resources.GetObject("dgrdData.FilterBar")));
			this.dgrdData.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("dgrdData.FlatStyle")));
			this.dgrdData.Font = ((System.Drawing.Font)(resources.GetObject("dgrdData.Font")));
			this.dgrdData.GroupByAreaVisible = ((bool)(resources.GetObject("dgrdData.GroupByAreaVisible")));
			this.dgrdData.GroupByCaption = resources.GetString("dgrdData.GroupByCaption");
			this.dgrdData.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
			this.dgrdData.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("dgrdData.ImeMode")));
			this.dgrdData.LinesPerRow = ((int)(resources.GetObject("dgrdData.LinesPerRow")));
			this.dgrdData.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.Location")));
			this.dgrdData.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
			this.dgrdData.Name = "dgrdData";
			this.dgrdData.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureAddnewRow")));
			this.dgrdData.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureCurrentRow")));
			this.dgrdData.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFilterBar")));
			this.dgrdData.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureFooterRow")));
			this.dgrdData.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureHeaderRow")));
			this.dgrdData.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureModifiedRow")));
			this.dgrdData.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("dgrdData.PictureStandardRow")));
			this.dgrdData.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("dgrdData.PreviewInfo.AllowSizing")));
			this.dgrdData.PreviewInfo.Caption = resources.GetString("dgrdData.PreviewInfo.Caption");
			this.dgrdData.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("dgrdData.PreviewInfo.Location")));
			this.dgrdData.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.PreviewInfo.Size")));
			this.dgrdData.PreviewInfo.ToolBars = ((bool)(resources.GetObject("dgrdData.PreviewInfo.ToolBars")));
			this.dgrdData.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("dgrdData.PreviewInfo.UIStrings.Content")));
			this.dgrdData.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("dgrdData.PreviewInfo.ZoomFactor")));
			this.dgrdData.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.MaxRowHeight")));
			this.dgrdData.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageFooter")));
			this.dgrdData.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.OwnerDrawPageHeader")));
			this.dgrdData.PrintInfo.PageFooter = resources.GetString("dgrdData.PrintInfo.PageFooter");
			this.dgrdData.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageFooterHeight")));
			this.dgrdData.PrintInfo.PageHeader = resources.GetString("dgrdData.PrintInfo.PageHeader");
			this.dgrdData.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("dgrdData.PrintInfo.PageHeaderHeight")));
			this.dgrdData.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("dgrdData.PrintInfo.PrintHorizontalSplits")));
			this.dgrdData.PrintInfo.ProgressCaption = resources.GetString("dgrdData.PrintInfo.ProgressCaption");
			this.dgrdData.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnFooters")));
			this.dgrdData.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatColumnHeaders")));
			this.dgrdData.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatGridHeader")));
			this.dgrdData.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("dgrdData.PrintInfo.RepeatSplitHeaders")));
			this.dgrdData.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowOptionsDialog")));
			this.dgrdData.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowProgressForm")));
			this.dgrdData.PrintInfo.ShowSelection = ((bool)(resources.GetObject("dgrdData.PrintInfo.ShowSelection")));
			this.dgrdData.PrintInfo.UseGridColors = ((bool)(resources.GetObject("dgrdData.PrintInfo.UseGridColors")));
			this.dgrdData.RecordSelectors = ((bool)(resources.GetObject("dgrdData.RecordSelectors")));
			this.dgrdData.RecordSelectorWidth = ((int)(resources.GetObject("dgrdData.RecordSelectorWidth")));
			this.dgrdData.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("dgrdData.RightToLeft")));
			this.dgrdData.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
			this.dgrdData.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
			this.dgrdData.RowHeight = ((int)(resources.GetObject("dgrdData.RowHeight")));
			this.dgrdData.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("dgrdData.RowSubDividerColor")));
			this.dgrdData.ScrollTips = ((bool)(resources.GetObject("dgrdData.ScrollTips")));
			this.dgrdData.ScrollTrack = ((bool)(resources.GetObject("dgrdData.ScrollTrack")));
			this.dgrdData.Size = ((System.Drawing.Size)(resources.GetObject("dgrdData.Size")));
			this.dgrdData.SpringMode = ((bool)(resources.GetObject("dgrdData.SpringMode")));
			this.dgrdData.TabAcrossSplits = ((bool)(resources.GetObject("dgrdData.TabAcrossSplits")));
			this.dgrdData.TabIndex = ((int)(resources.GetObject("dgrdData.TabIndex")));
			this.dgrdData.Text = resources.GetString("dgrdData.Text");
			this.dgrdData.ViewCaptionWidth = ((int)(resources.GetObject("dgrdData.ViewCaptionWidth")));
			this.dgrdData.ViewColumnWidth = ((int)(resources.GetObject("dgrdData.ViewColumnWidth")));
			this.dgrdData.Visible = ((bool)(resources.GetObject("dgrdData.Visible")));
			this.dgrdData.WrapCellPointer = ((bool)(resources.GetObject("dgrdData.WrapCellPointer")));
			this.dgrdData.ButtonClick += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_ButtonClick);
			this.dgrdData.AfterColUpdate += new C1.Win.C1TrueDBGrid.ColEventHandler(this.dgrdData_AfterColUpdate);
			this.dgrdData.BeforeColUpdate += new C1.Win.C1TrueDBGrid.BeforeColUpdateEventHandler(this.dgrdData_BeforeColUpdate);
			this.dgrdData.BeforeColEdit += new BeforeColEditEventHandler(dgrdData_BeforeColEdit);
			this.dgrdData.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dgrdData_KeyDown);
			this.dgrdData.PropBag = resources.GetString("dgrdData.PropBag");
			// 
			// cboCCN
			// 
			this.cboCCN.AccessibleDescription = resources.GetString("cboCCN.AccessibleDescription");
			this.cboCCN.AccessibleName = resources.GetString("cboCCN.AccessibleName");
			this.cboCCN.AddItemSeparator = ';';
			this.cboCCN.AllowRowSizing = C1.Win.C1List.RowSizingEnum.AllRows;
			this.cboCCN.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("cboCCN.Anchor")));
			this.cboCCN.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("cboCCN.BackgroundImage")));
			this.cboCCN.Caption = "";
			this.cboCCN.CaptionHeight = 17;
			this.cboCCN.CharacterCasing = System.Windows.Forms.CharacterCasing.Normal;
			this.cboCCN.ColumnCaptionHeight = 17;
			this.cboCCN.ColumnFooterHeight = 17;
			this.cboCCN.ComboStyle = C1.Win.C1List.ComboStyleEnum.DropdownList;
			this.cboCCN.ContentHeight = 15;
			this.cboCCN.DeadAreaBackColor = System.Drawing.Color.Empty;
			this.cboCCN.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("cboCCN.Dock")));
			this.cboCCN.EditorBackColor = System.Drawing.SystemColors.Window;
			this.cboCCN.EditorFont = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
			this.cboCCN.EditorForeColor = System.Drawing.SystemColors.WindowText;
			this.cboCCN.EditorHeight = 15;
			this.cboCCN.Enabled = ((bool)(resources.GetObject("cboCCN.Enabled")));
			this.cboCCN.FlatStyle = C1.Win.C1List.FlatModeEnum.System;
			this.cboCCN.Font = ((System.Drawing.Font)(resources.GetObject("cboCCN.Font")));
			this.cboCCN.GapHeight = 2;
			this.cboCCN.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("cboCCN.ImeMode")));
			this.cboCCN.ItemHeight = 15;
			this.cboCCN.Location = ((System.Drawing.Point)(resources.GetObject("cboCCN.Location")));
			this.cboCCN.MatchEntryTimeout = ((long)(2000));
			this.cboCCN.MaxDropDownItems = ((short)(5));
			this.cboCCN.MaxLength = 32767;
			this.cboCCN.MouseCursor = System.Windows.Forms.Cursors.Default;
			this.cboCCN.Name = "cboCCN";
			this.cboCCN.PartialRightColumn = false;
			this.cboCCN.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("cboCCN.RightToLeft")));
			this.cboCCN.RowDivider.Color = System.Drawing.Color.DarkGray;
			this.cboCCN.RowDivider.Style = C1.Win.C1List.LineStyleEnum.None;
			this.cboCCN.RowSubDividerColor = System.Drawing.Color.DarkGray;
			this.cboCCN.Size = ((System.Drawing.Size)(resources.GetObject("cboCCN.Size")));
			this.cboCCN.TabIndex = ((int)(resources.GetObject("cboCCN.TabIndex")));
			this.cboCCN.Text = resources.GetString("cboCCN.Text");
			this.cboCCN.Visible = ((bool)(resources.GetObject("cboCCN.Visible")));
			this.cboCCN.TextChanged += new System.EventHandler(this.cboCCN_TextChanged);
			this.cboCCN.PropBag = "<?xml version=\"1.0\"?><Blob><Styles type=\"C1.Win.C1List.Design.ContextWrapper\"><Da" +
				"ta>Group{BackColor:ControlDark;Border:None,,0, 0, 0, 0;AlignVert:Center;}Style2{" +
				"}Style5{}Style4{}Style7{}Style6{}EvenRow{BackColor:Aqua;}Selected{ForeColor:High" +
				"lightText;BackColor:Highlight;}Style3{}Inactive{ForeColor:InactiveCaptionText;Ba" +
				"ckColor:InactiveCaption;}Footer{}Caption{AlignHorz:Center;}Normal{BackColor:Wind" +
				"ow;}HighlightRow{ForeColor:HighlightText;BackColor:Highlight;}Style9{AlignHorz:N" +
				"ear;}OddRow{}RecordSelector{AlignImage:Center;}Heading{Wrap:True;AlignVert:Cente" +
				"r;Border:Raised,,1, 1, 1, 1;ForeColor:ControlText;BackColor:Control;}Style8{}Sty" +
				"le10{}Style11{}Style1{}</Data></Styles><Splits><C1.Win.C1List.ListBoxView AllowC" +
				"olSelect=\"False\" Name=\"\" CaptionHeight=\"17\" ColumnCaptionHeight=\"17\" ColumnFoote" +
				"rHeight=\"17\" VerticalScrollGroup=\"1\" HorizontalScrollGroup=\"1\"><ClientRect>0, 0," +
				" 116, 156</ClientRect><VScrollBar><Width>16</Width></VScrollBar><HScrollBar><Hei" +
				"ght>16</Height></HScrollBar><CaptionStyle parent=\"Style2\" me=\"Style9\" /><EvenRow" +
				"Style parent=\"EvenRow\" me=\"Style7\" /><FooterStyle parent=\"Footer\" me=\"Style3\" />" +
				"<GroupStyle parent=\"Group\" me=\"Style11\" /><HeadingStyle parent=\"Heading\" me=\"Sty" +
				"le2\" /><HighLightRowStyle parent=\"HighlightRow\" me=\"Style6\" /><InactiveStyle par" +
				"ent=\"Inactive\" me=\"Style4\" /><OddRowStyle parent=\"OddRow\" me=\"Style8\" /><RecordS" +
				"electorStyle parent=\"RecordSelector\" me=\"Style10\" /><SelectedStyle parent=\"Selec" +
				"ted\" me=\"Style5\" /><Style parent=\"Normal\" me=\"Style1\" /></C1.Win.C1List.ListBoxV" +
				"iew></Splits><NamedStyles><Style parent=\"\" me=\"Normal\" /><Style parent=\"Normal\" " +
				"me=\"Heading\" /><Style parent=\"Heading\" me=\"Footer\" /><Style parent=\"Heading\" me=" +
				"\"Caption\" /><Style parent=\"Heading\" me=\"Inactive\" /><Style parent=\"Normal\" me=\"S" +
				"elected\" /><Style parent=\"Normal\" me=\"HighlightRow\" /><Style parent=\"Normal\" me=" +
				"\"EvenRow\" /><Style parent=\"Normal\" me=\"OddRow\" /><Style parent=\"Heading\" me=\"Rec" +
				"ordSelector\" /><Style parent=\"Caption\" me=\"Group\" /></NamedStyles><vertSplits>1<" +
				"/vertSplits><horzSplits>1</horzSplits><Layout>Modified</Layout><DefaultRecSelWid" +
				"th>16</DefaultRecSelWidth></Blob>";
			// 
			// lblLable1
			// 
			this.lblLable1.AccessibleDescription = resources.GetString("lblLable1.AccessibleDescription");
			this.lblLable1.AccessibleName = resources.GetString("lblLable1.AccessibleName");
			this.lblLable1.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblLable1.Anchor")));
			this.lblLable1.AutoSize = ((bool)(resources.GetObject("lblLable1.AutoSize")));
			this.lblLable1.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblLable1.Dock")));
			this.lblLable1.Enabled = ((bool)(resources.GetObject("lblLable1.Enabled")));
			this.lblLable1.Font = ((System.Drawing.Font)(resources.GetObject("lblLable1.Font")));
			this.lblLable1.ForeColor = System.Drawing.Color.Maroon;
			this.lblLable1.Image = ((System.Drawing.Image)(resources.GetObject("lblLable1.Image")));
			this.lblLable1.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable1.ImageAlign")));
			this.lblLable1.ImageIndex = ((int)(resources.GetObject("lblLable1.ImageIndex")));
			this.lblLable1.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblLable1.ImeMode")));
			this.lblLable1.Location = ((System.Drawing.Point)(resources.GetObject("lblLable1.Location")));
			this.lblLable1.Name = "lblLable1";
			this.lblLable1.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblLable1.RightToLeft")));
			this.lblLable1.Size = ((System.Drawing.Size)(resources.GetObject("lblLable1.Size")));
			this.lblLable1.TabIndex = ((int)(resources.GetObject("lblLable1.TabIndex")));
			this.lblLable1.Text = resources.GetString("lblLable1.Text");
			this.lblLable1.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblLable1.TextAlign")));
			this.lblLable1.Visible = ((bool)(resources.GetObject("lblLable1.Visible")));
			// 
			// lblRevision
			// 
			this.lblRevision.AccessibleDescription = resources.GetString("lblRevision.AccessibleDescription");
			this.lblRevision.AccessibleName = resources.GetString("lblRevision.AccessibleName");
			this.lblRevision.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRevision.Anchor")));
			this.lblRevision.AutoSize = ((bool)(resources.GetObject("lblRevision.AutoSize")));
			this.lblRevision.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRevision.Dock")));
			this.lblRevision.Enabled = ((bool)(resources.GetObject("lblRevision.Enabled")));
			this.lblRevision.Font = ((System.Drawing.Font)(resources.GetObject("lblRevision.Font")));
			this.lblRevision.ForeColor = System.Drawing.Color.Black;
			this.lblRevision.Image = ((System.Drawing.Image)(resources.GetObject("lblRevision.Image")));
			this.lblRevision.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.ImageAlign")));
			this.lblRevision.ImageIndex = ((int)(resources.GetObject("lblRevision.ImageIndex")));
			this.lblRevision.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRevision.ImeMode")));
			this.lblRevision.Location = ((System.Drawing.Point)(resources.GetObject("lblRevision.Location")));
			this.lblRevision.Name = "lblRevision";
			this.lblRevision.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRevision.RightToLeft")));
			this.lblRevision.Size = ((System.Drawing.Size)(resources.GetObject("lblRevision.Size")));
			this.lblRevision.TabIndex = ((int)(resources.GetObject("lblRevision.TabIndex")));
			this.lblRevision.Text = resources.GetString("lblRevision.Text");
			this.lblRevision.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRevision.TextAlign")));
			this.lblRevision.Visible = ((bool)(resources.GetObject("lblRevision.Visible")));
			// 
			// lblDescription
			// 
			this.lblDescription.AccessibleDescription = resources.GetString("lblDescription.AccessibleDescription");
			this.lblDescription.AccessibleName = resources.GetString("lblDescription.AccessibleName");
			this.lblDescription.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblDescription.Anchor")));
			this.lblDescription.AutoSize = ((bool)(resources.GetObject("lblDescription.AutoSize")));
			this.lblDescription.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblDescription.Dock")));
			this.lblDescription.Enabled = ((bool)(resources.GetObject("lblDescription.Enabled")));
			this.lblDescription.Font = ((System.Drawing.Font)(resources.GetObject("lblDescription.Font")));
			this.lblDescription.ForeColor = System.Drawing.Color.Black;
			this.lblDescription.Image = ((System.Drawing.Image)(resources.GetObject("lblDescription.Image")));
			this.lblDescription.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDescription.ImageAlign")));
			this.lblDescription.ImageIndex = ((int)(resources.GetObject("lblDescription.ImageIndex")));
			this.lblDescription.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblDescription.ImeMode")));
			this.lblDescription.Location = ((System.Drawing.Point)(resources.GetObject("lblDescription.Location")));
			this.lblDescription.Name = "lblDescription";
			this.lblDescription.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblDescription.RightToLeft")));
			this.lblDescription.Size = ((System.Drawing.Size)(resources.GetObject("lblDescription.Size")));
			this.lblDescription.TabIndex = ((int)(resources.GetObject("lblDescription.TabIndex")));
			this.lblDescription.Text = resources.GetString("lblDescription.Text");
			this.lblDescription.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblDescription.TextAlign")));
			this.lblDescription.Visible = ((bool)(resources.GetObject("lblDescription.Visible")));
			// 
			// lblCode
			// 
			this.lblCode.AccessibleDescription = resources.GetString("lblCode.AccessibleDescription");
			this.lblCode.AccessibleName = resources.GetString("lblCode.AccessibleName");
			this.lblCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblCode.Anchor")));
			this.lblCode.AutoSize = ((bool)(resources.GetObject("lblCode.AutoSize")));
			this.lblCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblCode.Dock")));
			this.lblCode.Enabled = ((bool)(resources.GetObject("lblCode.Enabled")));
			this.lblCode.Font = ((System.Drawing.Font)(resources.GetObject("lblCode.Font")));
			this.lblCode.ForeColor = System.Drawing.Color.Black;
			this.lblCode.Image = ((System.Drawing.Image)(resources.GetObject("lblCode.Image")));
			this.lblCode.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCode.ImageAlign")));
			this.lblCode.ImageIndex = ((int)(resources.GetObject("lblCode.ImageIndex")));
			this.lblCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblCode.ImeMode")));
			this.lblCode.Location = ((System.Drawing.Point)(resources.GetObject("lblCode.Location")));
			this.lblCode.Name = "lblCode";
			this.lblCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblCode.RightToLeft")));
			this.lblCode.Size = ((System.Drawing.Size)(resources.GetObject("lblCode.Size")));
			this.lblCode.TabIndex = ((int)(resources.GetObject("lblCode.TabIndex")));
			this.lblCode.Text = resources.GetString("lblCode.Text");
			this.lblCode.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblCode.TextAlign")));
			this.lblCode.Visible = ((bool)(resources.GetObject("lblCode.Visible")));
			// 
			// lblComment
			// 
			this.lblComment.AccessibleDescription = resources.GetString("lblComment.AccessibleDescription");
			this.lblComment.AccessibleName = resources.GetString("lblComment.AccessibleName");
			this.lblComment.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblComment.Anchor")));
			this.lblComment.AutoSize = ((bool)(resources.GetObject("lblComment.AutoSize")));
			this.lblComment.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblComment.Dock")));
			this.lblComment.Enabled = ((bool)(resources.GetObject("lblComment.Enabled")));
			this.lblComment.Font = ((System.Drawing.Font)(resources.GetObject("lblComment.Font")));
			this.lblComment.Image = ((System.Drawing.Image)(resources.GetObject("lblComment.Image")));
			this.lblComment.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblComment.ImageAlign")));
			this.lblComment.ImageIndex = ((int)(resources.GetObject("lblComment.ImageIndex")));
			this.lblComment.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblComment.ImeMode")));
			this.lblComment.Location = ((System.Drawing.Point)(resources.GetObject("lblComment.Location")));
			this.lblComment.Name = "lblComment";
			this.lblComment.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblComment.RightToLeft")));
			this.lblComment.Size = ((System.Drawing.Size)(resources.GetObject("lblComment.Size")));
			this.lblComment.TabIndex = ((int)(resources.GetObject("lblComment.TabIndex")));
			this.lblComment.Text = resources.GetString("lblComment.Text");
			this.lblComment.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblComment.TextAlign")));
			this.lblComment.Visible = ((bool)(resources.GetObject("lblComment.Visible")));
			// 
			// lblIncreament
			// 
			this.lblIncreament.AccessibleDescription = resources.GetString("lblIncreament.AccessibleDescription");
			this.lblIncreament.AccessibleName = resources.GetString("lblIncreament.AccessibleName");
			this.lblIncreament.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblIncreament.Anchor")));
			this.lblIncreament.AutoSize = ((bool)(resources.GetObject("lblIncreament.AutoSize")));
			this.lblIncreament.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblIncreament.Dock")));
			this.lblIncreament.Enabled = ((bool)(resources.GetObject("lblIncreament.Enabled")));
			this.lblIncreament.Font = ((System.Drawing.Font)(resources.GetObject("lblIncreament.Font")));
			this.lblIncreament.Image = ((System.Drawing.Image)(resources.GetObject("lblIncreament.Image")));
			this.lblIncreament.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblIncreament.ImageAlign")));
			this.lblIncreament.ImageIndex = ((int)(resources.GetObject("lblIncreament.ImageIndex")));
			this.lblIncreament.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblIncreament.ImeMode")));
			this.lblIncreament.Location = ((System.Drawing.Point)(resources.GetObject("lblIncreament.Location")));
			this.lblIncreament.Name = "lblIncreament";
			this.lblIncreament.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblIncreament.RightToLeft")));
			this.lblIncreament.Size = ((System.Drawing.Size)(resources.GetObject("lblIncreament.Size")));
			this.lblIncreament.TabIndex = ((int)(resources.GetObject("lblIncreament.TabIndex")));
			this.lblIncreament.Text = resources.GetString("lblIncreament.Text");
			this.lblIncreament.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblIncreament.TextAlign")));
			this.lblIncreament.Visible = ((bool)(resources.GetObject("lblIncreament.Visible")));
			// 
			// txtItemCode
			// 
			this.txtItemCode.AccessibleDescription = resources.GetString("txtItemCode.AccessibleDescription");
			this.txtItemCode.AccessibleName = resources.GetString("txtItemCode.AccessibleName");
			this.txtItemCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtItemCode.Anchor")));
			this.txtItemCode.AutoSize = ((bool)(resources.GetObject("txtItemCode.AutoSize")));
			this.txtItemCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtItemCode.BackgroundImage")));
			this.txtItemCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtItemCode.Dock")));
			this.txtItemCode.Enabled = ((bool)(resources.GetObject("txtItemCode.Enabled")));
			this.txtItemCode.Font = ((System.Drawing.Font)(resources.GetObject("txtItemCode.Font")));
			this.txtItemCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtItemCode.ImeMode")));
			this.txtItemCode.Location = ((System.Drawing.Point)(resources.GetObject("txtItemCode.Location")));
			this.txtItemCode.MaxLength = ((int)(resources.GetObject("txtItemCode.MaxLength")));
			this.txtItemCode.Multiline = ((bool)(resources.GetObject("txtItemCode.Multiline")));
			this.txtItemCode.Name = "txtItemCode";
			this.txtItemCode.PasswordChar = ((char)(resources.GetObject("txtItemCode.PasswordChar")));
			this.txtItemCode.ReadOnly = true;
			this.txtItemCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtItemCode.RightToLeft")));
			this.txtItemCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtItemCode.ScrollBars")));
			this.txtItemCode.Size = ((System.Drawing.Size)(resources.GetObject("txtItemCode.Size")));
			this.txtItemCode.TabIndex = ((int)(resources.GetObject("txtItemCode.TabIndex")));
			this.txtItemCode.Text = resources.GetString("txtItemCode.Text");
			this.txtItemCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtItemCode.TextAlign")));
			this.txtItemCode.Visible = ((bool)(resources.GetObject("txtItemCode.Visible")));
			this.txtItemCode.WordWrap = ((bool)(resources.GetObject("txtItemCode.WordWrap")));
			// 
			// txtBOMDes
			// 
			this.txtBOMDes.AccessibleDescription = resources.GetString("txtBOMDes.AccessibleDescription");
			this.txtBOMDes.AccessibleName = resources.GetString("txtBOMDes.AccessibleName");
			this.txtBOMDes.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtBOMDes.Anchor")));
			this.txtBOMDes.AutoSize = ((bool)(resources.GetObject("txtBOMDes.AutoSize")));
			this.txtBOMDes.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtBOMDes.BackgroundImage")));
			this.txtBOMDes.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtBOMDes.Dock")));
			this.txtBOMDes.Enabled = ((bool)(resources.GetObject("txtBOMDes.Enabled")));
			this.txtBOMDes.Font = ((System.Drawing.Font)(resources.GetObject("txtBOMDes.Font")));
			this.txtBOMDes.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtBOMDes.ImeMode")));
			this.txtBOMDes.Location = ((System.Drawing.Point)(resources.GetObject("txtBOMDes.Location")));
			this.txtBOMDes.MaxLength = ((int)(resources.GetObject("txtBOMDes.MaxLength")));
			this.txtBOMDes.Multiline = ((bool)(resources.GetObject("txtBOMDes.Multiline")));
			this.txtBOMDes.Name = "txtBOMDes";
			this.txtBOMDes.PasswordChar = ((char)(resources.GetObject("txtBOMDes.PasswordChar")));
			this.txtBOMDes.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtBOMDes.RightToLeft")));
			this.txtBOMDes.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtBOMDes.ScrollBars")));
			this.txtBOMDes.Size = ((System.Drawing.Size)(resources.GetObject("txtBOMDes.Size")));
			this.txtBOMDes.TabIndex = ((int)(resources.GetObject("txtBOMDes.TabIndex")));
			this.txtBOMDes.Text = resources.GetString("txtBOMDes.Text");
			this.txtBOMDes.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtBOMDes.TextAlign")));
			this.txtBOMDes.Visible = ((bool)(resources.GetObject("txtBOMDes.Visible")));
			this.txtBOMDes.WordWrap = ((bool)(resources.GetObject("txtBOMDes.WordWrap")));
			// 
			// txtModel
			// 
			this.txtModel.AccessibleDescription = resources.GetString("txtModel.AccessibleDescription");
			this.txtModel.AccessibleName = resources.GetString("txtModel.AccessibleName");
			this.txtModel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtModel.Anchor")));
			this.txtModel.AutoSize = ((bool)(resources.GetObject("txtModel.AutoSize")));
			this.txtModel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtModel.BackgroundImage")));
			this.txtModel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtModel.Dock")));
			this.txtModel.Enabled = ((bool)(resources.GetObject("txtModel.Enabled")));
			this.txtModel.Font = ((System.Drawing.Font)(resources.GetObject("txtModel.Font")));
			this.txtModel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtModel.ImeMode")));
			this.txtModel.Location = ((System.Drawing.Point)(resources.GetObject("txtModel.Location")));
			this.txtModel.MaxLength = ((int)(resources.GetObject("txtModel.MaxLength")));
			this.txtModel.Multiline = ((bool)(resources.GetObject("txtModel.Multiline")));
			this.txtModel.Name = "txtModel";
			this.txtModel.PasswordChar = ((char)(resources.GetObject("txtModel.PasswordChar")));
			this.txtModel.ReadOnly = true;
			this.txtModel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtModel.RightToLeft")));
			this.txtModel.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtModel.ScrollBars")));
			this.txtModel.Size = ((System.Drawing.Size)(resources.GetObject("txtModel.Size")));
			this.txtModel.TabIndex = ((int)(resources.GetObject("txtModel.TabIndex")));
			this.txtModel.TabStop = false;
			this.txtModel.Text = resources.GetString("txtModel.Text");
			this.txtModel.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtModel.TextAlign")));
			this.txtModel.Visible = ((bool)(resources.GetObject("txtModel.Visible")));
			this.txtModel.WordWrap = ((bool)(resources.GetObject("txtModel.WordWrap")));
			// 
			// txtPartName
			// 
			this.txtPartName.AccessibleDescription = resources.GetString("txtPartName.AccessibleDescription");
			this.txtPartName.AccessibleName = resources.GetString("txtPartName.AccessibleName");
			this.txtPartName.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtPartName.Anchor")));
			this.txtPartName.AutoSize = ((bool)(resources.GetObject("txtPartName.AutoSize")));
			this.txtPartName.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtPartName.BackgroundImage")));
			this.txtPartName.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtPartName.Dock")));
			this.txtPartName.Enabled = ((bool)(resources.GetObject("txtPartName.Enabled")));
			this.txtPartName.Font = ((System.Drawing.Font)(resources.GetObject("txtPartName.Font")));
			this.txtPartName.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtPartName.ImeMode")));
			this.txtPartName.Location = ((System.Drawing.Point)(resources.GetObject("txtPartName.Location")));
			this.txtPartName.MaxLength = ((int)(resources.GetObject("txtPartName.MaxLength")));
			this.txtPartName.Multiline = ((bool)(resources.GetObject("txtPartName.Multiline")));
			this.txtPartName.Name = "txtPartName";
			this.txtPartName.PasswordChar = ((char)(resources.GetObject("txtPartName.PasswordChar")));
			this.txtPartName.ReadOnly = true;
			this.txtPartName.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtPartName.RightToLeft")));
			this.txtPartName.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtPartName.ScrollBars")));
			this.txtPartName.Size = ((System.Drawing.Size)(resources.GetObject("txtPartName.Size")));
			this.txtPartName.TabIndex = ((int)(resources.GetObject("txtPartName.TabIndex")));
			this.txtPartName.TabStop = false;
			this.txtPartName.Text = resources.GetString("txtPartName.Text");
			this.txtPartName.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtPartName.TextAlign")));
			this.txtPartName.Visible = ((bool)(resources.GetObject("txtPartName.Visible")));
			this.txtPartName.WordWrap = ((bool)(resources.GetObject("txtPartName.WordWrap")));
			// 
			// txtIncrement
			// 
			this.txtIncrement.AcceptsEscape = ((bool)(resources.GetObject("txtIncrement.AcceptsEscape")));
			this.txtIncrement.AccessibleDescription = resources.GetString("txtIncrement.AccessibleDescription");
			this.txtIncrement.AccessibleName = resources.GetString("txtIncrement.AccessibleName");
			this.txtIncrement.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtIncrement.Anchor")));
			this.txtIncrement.AutoSize = ((bool)(resources.GetObject("txtIncrement.AutoSize")));
			this.txtIncrement.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtIncrement.BackgroundImage")));
			this.txtIncrement.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("txtIncrement.BorderStyle")));
			// 
			// txtIncrement.Calculator
			// 
			this.txtIncrement.Calculator.AccessibleDescription = resources.GetString("txtIncrement.Calculator.AccessibleDescription");
			this.txtIncrement.Calculator.AccessibleName = resources.GetString("txtIncrement.Calculator.AccessibleName");
			this.txtIncrement.Calculator.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtIncrement.Calculator.BackgroundImage")));
			this.txtIncrement.Calculator.ButtonFlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("txtIncrement.Calculator.ButtonFlatStyle")));
			this.txtIncrement.Calculator.DisplayFormat = resources.GetString("txtIncrement.Calculator.DisplayFormat");
			this.txtIncrement.Calculator.Font = ((System.Drawing.Font)(resources.GetObject("txtIncrement.Calculator.Font")));
			this.txtIncrement.Calculator.FormatOnClose = ((bool)(resources.GetObject("txtIncrement.Calculator.FormatOnClose")));
			this.txtIncrement.Calculator.StoredFormat = resources.GetString("txtIncrement.Calculator.StoredFormat");
			this.txtIncrement.Calculator.UIStrings.Content = ((string[])(resources.GetObject("txtIncrement.Calculator.UIStrings.Content")));
			this.txtIncrement.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.CaseSensitive")));
			this.txtIncrement.Culture = ((int)(resources.GetObject("txtIncrement.Culture")));
			this.txtIncrement.CustomFormat = resources.GetString("txtIncrement.CustomFormat");
			this.txtIncrement.DataType = ((System.Type)(resources.GetObject("txtIncrement.DataType")));
			this.txtIncrement.DisplayFormat.CustomFormat = resources.GetString("txtIncrement.DisplayFormat.CustomFormat");
			this.txtIncrement.DisplayFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.DisplayFormat.FormatType")));
			this.txtIncrement.DisplayFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtIncrement.DisplayFormat.Inherit")));
			this.txtIncrement.DisplayFormat.NullText = resources.GetString("txtIncrement.DisplayFormat.NullText");
			this.txtIncrement.DisplayFormat.TrimEnd = ((bool)(resources.GetObject("txtIncrement.DisplayFormat.TrimEnd")));
			this.txtIncrement.DisplayFormat.TrimStart = ((bool)(resources.GetObject("txtIncrement.DisplayFormat.TrimStart")));
			this.txtIncrement.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtIncrement.Dock")));
			this.txtIncrement.DropDownFormAlign = ((C1.Win.C1Input.DropDownFormAlignmentEnum)(resources.GetObject("txtIncrement.DropDownFormAlign")));
			this.txtIncrement.EditFormat.CustomFormat = resources.GetString("txtIncrement.EditFormat.CustomFormat");
			this.txtIncrement.EditFormat.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.EditFormat.FormatType")));
			this.txtIncrement.EditFormat.Inherit = ((C1.Win.C1Input.FormatInfoInheritFlags)(resources.GetObject("txtIncrement.EditFormat.Inherit")));
			this.txtIncrement.EditFormat.NullText = resources.GetString("txtIncrement.EditFormat.NullText");
			this.txtIncrement.EditFormat.TrimEnd = ((bool)(resources.GetObject("txtIncrement.EditFormat.TrimEnd")));
			this.txtIncrement.EditFormat.TrimStart = ((bool)(resources.GetObject("txtIncrement.EditFormat.TrimStart")));
			this.txtIncrement.EditMask = resources.GetString("txtIncrement.EditMask");
			this.txtIncrement.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.EmptyAsNull")));
			this.txtIncrement.Enabled = ((bool)(resources.GetObject("txtIncrement.Enabled")));
			this.txtIncrement.ErrorInfo.BeepOnError = ((bool)(resources.GetObject("txtIncrement.ErrorInfo.BeepOnError")));
			this.txtIncrement.ErrorInfo.ErrorMessage = resources.GetString("txtIncrement.ErrorInfo.ErrorMessage");
			this.txtIncrement.ErrorInfo.ErrorMessageCaption = resources.GetString("txtIncrement.ErrorInfo.ErrorMessageCaption");
			this.txtIncrement.ErrorInfo.ShowErrorMessage = ((bool)(resources.GetObject("txtIncrement.ErrorInfo.ShowErrorMessage")));
			this.txtIncrement.ErrorInfo.ValueOnError = ((object)(resources.GetObject("txtIncrement.ErrorInfo.ValueOnError")));
			this.txtIncrement.Font = ((System.Drawing.Font)(resources.GetObject("txtIncrement.Font")));
			this.txtIncrement.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.FormatType")));
			this.txtIncrement.GapHeight = ((int)(resources.GetObject("txtIncrement.GapHeight")));
			this.txtIncrement.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtIncrement.ImeMode")));
			this.txtIncrement.Increment = ((object)(resources.GetObject("txtIncrement.Increment")));
			this.txtIncrement.InitialSelection = ((C1.Win.C1Input.InitialSelectionEnum)(resources.GetObject("txtIncrement.InitialSelection")));
			this.txtIncrement.Location = ((System.Drawing.Point)(resources.GetObject("txtIncrement.Location")));
			this.txtIncrement.MaskInfo.AutoTabWhenFilled = ((bool)(resources.GetObject("txtIncrement.MaskInfo.AutoTabWhenFilled")));
			this.txtIncrement.MaskInfo.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.MaskInfo.CaseSensitive")));
			this.txtIncrement.MaskInfo.CopyWithLiterals = ((bool)(resources.GetObject("txtIncrement.MaskInfo.CopyWithLiterals")));
			this.txtIncrement.MaskInfo.EditMask = resources.GetString("txtIncrement.MaskInfo.EditMask");
			this.txtIncrement.MaskInfo.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.MaskInfo.EmptyAsNull")));
			this.txtIncrement.MaskInfo.ErrorMessage = resources.GetString("txtIncrement.MaskInfo.ErrorMessage");
			this.txtIncrement.MaskInfo.Inherit = ((C1.Win.C1Input.MaskInfoInheritFlags)(resources.GetObject("txtIncrement.MaskInfo.Inherit")));
			this.txtIncrement.MaskInfo.PromptChar = ((char)(resources.GetObject("txtIncrement.MaskInfo.PromptChar")));
			this.txtIncrement.MaskInfo.ShowLiterals = ((C1.Win.C1Input.ShowLiteralsEnum)(resources.GetObject("txtIncrement.MaskInfo.ShowLiterals")));
			this.txtIncrement.MaskInfo.StoredEmptyChar = ((char)(resources.GetObject("txtIncrement.MaskInfo.StoredEmptyChar")));
			this.txtIncrement.MaxLength = ((int)(resources.GetObject("txtIncrement.MaxLength")));
			this.txtIncrement.Name = "txtIncrement";
			this.txtIncrement.NullText = resources.GetString("txtIncrement.NullText");
			this.txtIncrement.NumericInputKeys = ((C1.Win.C1Input.NumericInputKeyFlags)(((C1.Win.C1Input.NumericInputKeyFlags.F9 | C1.Win.C1Input.NumericInputKeyFlags.Plus) 
				| C1.Win.C1Input.NumericInputKeyFlags.X)));
			this.txtIncrement.ParseInfo.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.ParseInfo.CaseSensitive")));
			this.txtIncrement.ParseInfo.CustomFormat = resources.GetString("txtIncrement.ParseInfo.CustomFormat");
			this.txtIncrement.ParseInfo.EmptyAsNull = ((bool)(resources.GetObject("txtIncrement.ParseInfo.EmptyAsNull")));
			this.txtIncrement.ParseInfo.ErrorMessage = resources.GetString("txtIncrement.ParseInfo.ErrorMessage");
			this.txtIncrement.ParseInfo.FormatType = ((C1.Win.C1Input.FormatTypeEnum)(resources.GetObject("txtIncrement.ParseInfo.FormatType")));
			this.txtIncrement.ParseInfo.Inherit = ((C1.Win.C1Input.ParseInfoInheritFlags)(resources.GetObject("txtIncrement.ParseInfo.Inherit")));
			this.txtIncrement.ParseInfo.NullText = resources.GetString("txtIncrement.ParseInfo.NullText");
			this.txtIncrement.ParseInfo.NumberStyle = ((C1.Win.C1Input.NumberStyleFlags)(resources.GetObject("txtIncrement.ParseInfo.NumberStyle")));
			this.txtIncrement.ParseInfo.TrimEnd = ((bool)(resources.GetObject("txtIncrement.ParseInfo.TrimEnd")));
			this.txtIncrement.ParseInfo.TrimStart = ((bool)(resources.GetObject("txtIncrement.ParseInfo.TrimStart")));
			this.txtIncrement.PasswordChar = ((char)(resources.GetObject("txtIncrement.PasswordChar")));
			this.txtIncrement.PostValidation.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.PostValidation.CaseSensitive")));
			this.txtIncrement.PostValidation.ErrorMessage = resources.GetString("txtIncrement.PostValidation.ErrorMessage");
			this.txtIncrement.PostValidation.Inherit = ((C1.Win.C1Input.PostValidationInheritFlags)(resources.GetObject("txtIncrement.PostValidation.Inherit")));
			this.txtIncrement.PostValidation.Intervals.AddRange(new C1.Win.C1Input.ValueInterval[] {
																									   ((C1.Win.C1Input.ValueInterval)(resources.GetObject("txtIncrement.PostValidation.Intervals")))});
			this.txtIncrement.PostValidation.Validation = ((C1.Win.C1Input.PostValidationTypeEnum)(resources.GetObject("txtIncrement.PostValidation.Validation")));
			this.txtIncrement.PostValidation.Values = ((System.Array)(resources.GetObject("txtIncrement.PostValidation.Values")));
			this.txtIncrement.PostValidation.ValuesExcluded = ((System.Array)(resources.GetObject("txtIncrement.PostValidation.ValuesExcluded")));
			this.txtIncrement.PreValidation.CaseSensitive = ((bool)(resources.GetObject("txtIncrement.PreValidation.CaseSensitive")));
			this.txtIncrement.PreValidation.ErrorMessage = resources.GetString("txtIncrement.PreValidation.ErrorMessage");
			this.txtIncrement.PreValidation.Inherit = ((C1.Win.C1Input.PreValidationInheritFlags)(resources.GetObject("txtIncrement.PreValidation.Inherit")));
			this.txtIncrement.PreValidation.ItemSeparator = resources.GetString("txtIncrement.PreValidation.ItemSeparator");
			this.txtIncrement.PreValidation.PatternString = resources.GetString("txtIncrement.PreValidation.PatternString");
			this.txtIncrement.PreValidation.RegexOptions = ((C1.Win.C1Input.RegexOptionFlags)(resources.GetObject("txtIncrement.PreValidation.RegexOptions")));
			this.txtIncrement.PreValidation.TrimEnd = ((bool)(resources.GetObject("txtIncrement.PreValidation.TrimEnd")));
			this.txtIncrement.PreValidation.TrimStart = ((bool)(resources.GetObject("txtIncrement.PreValidation.TrimStart")));
			this.txtIncrement.PreValidation.Validation = ((C1.Win.C1Input.PreValidationTypeEnum)(resources.GetObject("txtIncrement.PreValidation.Validation")));
			this.txtIncrement.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtIncrement.RightToLeft")));
			this.txtIncrement.ShowFocusRectangle = ((bool)(resources.GetObject("txtIncrement.ShowFocusRectangle")));
			this.txtIncrement.Size = ((System.Drawing.Size)(resources.GetObject("txtIncrement.Size")));
			this.txtIncrement.TabIndex = ((int)(resources.GetObject("txtIncrement.TabIndex")));
			this.txtIncrement.Tag = ((object)(resources.GetObject("txtIncrement.Tag")));
			this.txtIncrement.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtIncrement.TextAlign")));
			this.txtIncrement.TrimEnd = ((bool)(resources.GetObject("txtIncrement.TrimEnd")));
			this.txtIncrement.TrimStart = ((bool)(resources.GetObject("txtIncrement.TrimStart")));
			this.txtIncrement.UserCultureOverride = ((bool)(resources.GetObject("txtIncrement.UserCultureOverride")));
			this.txtIncrement.Value = ((object)(resources.GetObject("txtIncrement.Value")));
			this.txtIncrement.VerticalAlign = ((C1.Win.C1Input.VerticalAlignEnum)(resources.GetObject("txtIncrement.VerticalAlign")));
			this.txtIncrement.Visible = ((bool)(resources.GetObject("txtIncrement.Visible")));
			this.txtIncrement.VisibleButtons = ((C1.Win.C1Input.DropDownControlButtonFlags)(resources.GetObject("txtIncrement.VisibleButtons")));
			// 
			// txtWorkCenter
			// 
			this.txtWorkCenter.AccessibleDescription = resources.GetString("txtWorkCenter.AccessibleDescription");
			this.txtWorkCenter.AccessibleName = resources.GetString("txtWorkCenter.AccessibleName");
			this.txtWorkCenter.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtWorkCenter.Anchor")));
			this.txtWorkCenter.AutoSize = ((bool)(resources.GetObject("txtWorkCenter.AutoSize")));
			this.txtWorkCenter.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtWorkCenter.BackgroundImage")));
			this.txtWorkCenter.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtWorkCenter.Dock")));
			this.txtWorkCenter.Enabled = ((bool)(resources.GetObject("txtWorkCenter.Enabled")));
			this.txtWorkCenter.Font = ((System.Drawing.Font)(resources.GetObject("txtWorkCenter.Font")));
			this.txtWorkCenter.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtWorkCenter.ImeMode")));
			this.txtWorkCenter.Location = ((System.Drawing.Point)(resources.GetObject("txtWorkCenter.Location")));
			this.txtWorkCenter.MaxLength = ((int)(resources.GetObject("txtWorkCenter.MaxLength")));
			this.txtWorkCenter.Multiline = ((bool)(resources.GetObject("txtWorkCenter.Multiline")));
			this.txtWorkCenter.Name = "txtWorkCenter";
			this.txtWorkCenter.PasswordChar = ((char)(resources.GetObject("txtWorkCenter.PasswordChar")));
			this.txtWorkCenter.ReadOnly = true;
			this.txtWorkCenter.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtWorkCenter.RightToLeft")));
			this.txtWorkCenter.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtWorkCenter.ScrollBars")));
			this.txtWorkCenter.Size = ((System.Drawing.Size)(resources.GetObject("txtWorkCenter.Size")));
			this.txtWorkCenter.TabIndex = ((int)(resources.GetObject("txtWorkCenter.TabIndex")));
			this.txtWorkCenter.Text = resources.GetString("txtWorkCenter.Text");
			this.txtWorkCenter.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtWorkCenter.TextAlign")));
			this.txtWorkCenter.Visible = ((bool)(resources.GetObject("txtWorkCenter.Visible")));
			this.txtWorkCenter.WordWrap = ((bool)(resources.GetObject("txtWorkCenter.WordWrap")));
			// 
			// lblWorkcenter
			// 
			this.lblWorkcenter.AccessibleDescription = resources.GetString("lblWorkcenter.AccessibleDescription");
			this.lblWorkcenter.AccessibleName = resources.GetString("lblWorkcenter.AccessibleName");
			this.lblWorkcenter.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblWorkcenter.Anchor")));
			this.lblWorkcenter.AutoSize = ((bool)(resources.GetObject("lblWorkcenter.AutoSize")));
			this.lblWorkcenter.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblWorkcenter.Dock")));
			this.lblWorkcenter.Enabled = ((bool)(resources.GetObject("lblWorkcenter.Enabled")));
			this.lblWorkcenter.Font = ((System.Drawing.Font)(resources.GetObject("lblWorkcenter.Font")));
			this.lblWorkcenter.Image = ((System.Drawing.Image)(resources.GetObject("lblWorkcenter.Image")));
			this.lblWorkcenter.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWorkcenter.ImageAlign")));
			this.lblWorkcenter.ImageIndex = ((int)(resources.GetObject("lblWorkcenter.ImageIndex")));
			this.lblWorkcenter.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblWorkcenter.ImeMode")));
			this.lblWorkcenter.Location = ((System.Drawing.Point)(resources.GetObject("lblWorkcenter.Location")));
			this.lblWorkcenter.Name = "lblWorkcenter";
			this.lblWorkcenter.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblWorkcenter.RightToLeft")));
			this.lblWorkcenter.Size = ((System.Drawing.Size)(resources.GetObject("lblWorkcenter.Size")));
			this.lblWorkcenter.TabIndex = ((int)(resources.GetObject("lblWorkcenter.TabIndex")));
			this.lblWorkcenter.Text = resources.GetString("lblWorkcenter.Text");
			this.lblWorkcenter.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWorkcenter.TextAlign")));
			this.lblWorkcenter.Visible = ((bool)(resources.GetObject("lblWorkcenter.Visible")));
			// 
			// txtFGoodsCode
			// 
			this.txtFGoodsCode.AccessibleDescription = resources.GetString("txtFGoodsCode.AccessibleDescription");
			this.txtFGoodsCode.AccessibleName = resources.GetString("txtFGoodsCode.AccessibleName");
			this.txtFGoodsCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtFGoodsCode.Anchor")));
			this.txtFGoodsCode.AutoSize = ((bool)(resources.GetObject("txtFGoodsCode.AutoSize")));
			this.txtFGoodsCode.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtFGoodsCode.BackgroundImage")));
			this.txtFGoodsCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtFGoodsCode.Dock")));
			this.txtFGoodsCode.Enabled = ((bool)(resources.GetObject("txtFGoodsCode.Enabled")));
			this.txtFGoodsCode.Font = ((System.Drawing.Font)(resources.GetObject("txtFGoodsCode.Font")));
			this.txtFGoodsCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtFGoodsCode.ImeMode")));
			this.txtFGoodsCode.Location = ((System.Drawing.Point)(resources.GetObject("txtFGoodsCode.Location")));
			this.txtFGoodsCode.MaxLength = ((int)(resources.GetObject("txtFGoodsCode.MaxLength")));
			this.txtFGoodsCode.Multiline = ((bool)(resources.GetObject("txtFGoodsCode.Multiline")));
			this.txtFGoodsCode.Name = "txtFGoodsCode";
			this.txtFGoodsCode.PasswordChar = ((char)(resources.GetObject("txtFGoodsCode.PasswordChar")));
			this.txtFGoodsCode.ReadOnly = true;
			this.txtFGoodsCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtFGoodsCode.RightToLeft")));
			this.txtFGoodsCode.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtFGoodsCode.ScrollBars")));
			this.txtFGoodsCode.Size = ((System.Drawing.Size)(resources.GetObject("txtFGoodsCode.Size")));
			this.txtFGoodsCode.TabIndex = ((int)(resources.GetObject("txtFGoodsCode.TabIndex")));
			this.txtFGoodsCode.Text = resources.GetString("txtFGoodsCode.Text");
			this.txtFGoodsCode.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtFGoodsCode.TextAlign")));
			this.txtFGoodsCode.Visible = ((bool)(resources.GetObject("txtFGoodsCode.Visible")));
			this.txtFGoodsCode.WordWrap = ((bool)(resources.GetObject("txtFGoodsCode.WordWrap")));
			// 
			// lblFGoodsCode
			// 
			this.lblFGoodsCode.AccessibleDescription = resources.GetString("lblFGoodsCode.AccessibleDescription");
			this.lblFGoodsCode.AccessibleName = resources.GetString("lblFGoodsCode.AccessibleName");
			this.lblFGoodsCode.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblFGoodsCode.Anchor")));
			this.lblFGoodsCode.AutoSize = ((bool)(resources.GetObject("lblFGoodsCode.AutoSize")));
			this.lblFGoodsCode.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblFGoodsCode.Dock")));
			this.lblFGoodsCode.Enabled = ((bool)(resources.GetObject("lblFGoodsCode.Enabled")));
			this.lblFGoodsCode.Font = ((System.Drawing.Font)(resources.GetObject("lblFGoodsCode.Font")));
			this.lblFGoodsCode.ForeColor = System.Drawing.Color.Black;
			this.lblFGoodsCode.Image = ((System.Drawing.Image)(resources.GetObject("lblFGoodsCode.Image")));
			this.lblFGoodsCode.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblFGoodsCode.ImageAlign")));
			this.lblFGoodsCode.ImageIndex = ((int)(resources.GetObject("lblFGoodsCode.ImageIndex")));
			this.lblFGoodsCode.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblFGoodsCode.ImeMode")));
			this.lblFGoodsCode.Location = ((System.Drawing.Point)(resources.GetObject("lblFGoodsCode.Location")));
			this.lblFGoodsCode.Name = "lblFGoodsCode";
			this.lblFGoodsCode.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblFGoodsCode.RightToLeft")));
			this.lblFGoodsCode.Size = ((System.Drawing.Size)(resources.GetObject("lblFGoodsCode.Size")));
			this.lblFGoodsCode.TabIndex = ((int)(resources.GetObject("lblFGoodsCode.TabIndex")));
			this.lblFGoodsCode.Text = resources.GetString("lblFGoodsCode.Text");
			this.lblFGoodsCode.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblFGoodsCode.TextAlign")));
			this.lblFGoodsCode.Visible = ((bool)(resources.GetObject("lblFGoodsCode.Visible")));
			// 
			// txtWOMaster
			// 
			this.txtWOMaster.AccessibleDescription = resources.GetString("txtWOMaster.AccessibleDescription");
			this.txtWOMaster.AccessibleName = resources.GetString("txtWOMaster.AccessibleName");
			this.txtWOMaster.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("txtWOMaster.Anchor")));
			this.txtWOMaster.AutoSize = ((bool)(resources.GetObject("txtWOMaster.AutoSize")));
			this.txtWOMaster.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("txtWOMaster.BackgroundImage")));
			this.txtWOMaster.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("txtWOMaster.Dock")));
			this.txtWOMaster.Enabled = ((bool)(resources.GetObject("txtWOMaster.Enabled")));
			this.txtWOMaster.Font = ((System.Drawing.Font)(resources.GetObject("txtWOMaster.Font")));
			this.txtWOMaster.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("txtWOMaster.ImeMode")));
			this.txtWOMaster.Location = ((System.Drawing.Point)(resources.GetObject("txtWOMaster.Location")));
			this.txtWOMaster.MaxLength = ((int)(resources.GetObject("txtWOMaster.MaxLength")));
			this.txtWOMaster.Multiline = ((bool)(resources.GetObject("txtWOMaster.Multiline")));
			this.txtWOMaster.Name = "txtWOMaster";
			this.txtWOMaster.PasswordChar = ((char)(resources.GetObject("txtWOMaster.PasswordChar")));
			this.txtWOMaster.ReadOnly = true;
			this.txtWOMaster.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("txtWOMaster.RightToLeft")));
			this.txtWOMaster.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("txtWOMaster.ScrollBars")));
			this.txtWOMaster.Size = ((System.Drawing.Size)(resources.GetObject("txtWOMaster.Size")));
			this.txtWOMaster.TabIndex = ((int)(resources.GetObject("txtWOMaster.TabIndex")));
			this.txtWOMaster.Text = resources.GetString("txtWOMaster.Text");
			this.txtWOMaster.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("txtWOMaster.TextAlign")));
			this.txtWOMaster.Visible = ((bool)(resources.GetObject("txtWOMaster.Visible")));
			this.txtWOMaster.WordWrap = ((bool)(resources.GetObject("txtWOMaster.WordWrap")));
			// 
			// lblWOMaster
			// 
			this.lblWOMaster.AccessibleDescription = resources.GetString("lblWOMaster.AccessibleDescription");
			this.lblWOMaster.AccessibleName = resources.GetString("lblWOMaster.AccessibleName");
			this.lblWOMaster.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblWOMaster.Anchor")));
			this.lblWOMaster.AutoSize = ((bool)(resources.GetObject("lblWOMaster.AutoSize")));
			this.lblWOMaster.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblWOMaster.Dock")));
			this.lblWOMaster.Enabled = ((bool)(resources.GetObject("lblWOMaster.Enabled")));
			this.lblWOMaster.Font = ((System.Drawing.Font)(resources.GetObject("lblWOMaster.Font")));
			this.lblWOMaster.ForeColor = System.Drawing.Color.Black;
			this.lblWOMaster.Image = ((System.Drawing.Image)(resources.GetObject("lblWOMaster.Image")));
			this.lblWOMaster.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWOMaster.ImageAlign")));
			this.lblWOMaster.ImageIndex = ((int)(resources.GetObject("lblWOMaster.ImageIndex")));
			this.lblWOMaster.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblWOMaster.ImeMode")));
			this.lblWOMaster.Location = ((System.Drawing.Point)(resources.GetObject("lblWOMaster.Location")));
			this.lblWOMaster.Name = "lblWOMaster";
			this.lblWOMaster.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblWOMaster.RightToLeft")));
			this.lblWOMaster.Size = ((System.Drawing.Size)(resources.GetObject("lblWOMaster.Size")));
			this.lblWOMaster.TabIndex = ((int)(resources.GetObject("lblWOMaster.TabIndex")));
			this.lblWOMaster.Text = resources.GetString("lblWOMaster.Text");
			this.lblWOMaster.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblWOMaster.TextAlign")));
			this.lblWOMaster.Visible = ((bool)(resources.GetObject("lblWOMaster.Visible")));
			// 
			// WOBOM
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.CancelButton = this.btnOK;
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.txtWOMaster);
			this.Controls.Add(this.txtFGoodsCode);
			this.Controls.Add(this.txtWorkCenter);
			this.Controls.Add(this.txtPartName);
			this.Controls.Add(this.txtModel);
			this.Controls.Add(this.txtBOMDes);
			this.Controls.Add(this.txtItemCode);
			this.Controls.Add(this.dgrdData);
			this.Controls.Add(this.lblWOMaster);
			this.Controls.Add(this.lblFGoodsCode);
			this.Controls.Add(this.lblWorkcenter);
			this.Controls.Add(this.txtIncrement);
			this.Controls.Add(this.lblRevision);
			this.Controls.Add(this.lblDescription);
			this.Controls.Add(this.lblCode);
			this.Controls.Add(this.lblComment);
			this.Controls.Add(this.lblIncreament);
			this.Controls.Add(this.cboCCN);
			this.Controls.Add(this.lblLable1);
			this.Controls.Add(this.btnHelp);
			this.Controls.Add(this.btnSave);
			this.Controls.Add(this.btnEdit);
			this.Controls.Add(this.btnOK);
			this.Controls.Add(this.btnDelete);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.KeyPreview = true;
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "WOBOM";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Bom_KeyDown);
			this.Closing += new System.ComponentModel.CancelEventHandler(this.Bom_Closing);
			this.Load += new System.EventHandler(this.Bom_Load);
			((System.ComponentModel.ISupportInitialize)(this.dgrdData)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.cboCCN)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.txtIncrement)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private void ResetForm()
		{
			txtBOMDes.Text = string.Empty;
			txtItemCode.Text = string.Empty;
			txtModel.Text = string.Empty;
			txtPartName.Text = string.Empty;
			txtIncrement.Value = null;
			enumAction = EnumAction.Default;

			txtItemCode.Focus();
		}
		
		private void LoadComboCCN()
		{
			UtilsBO boUtils = new UtilsBO();
			DataSet dstCCN = boUtils.ListCCN();
			cboCCN.DataSource = dstCCN.Tables[MST_CCNTable.TABLE_NAME];
			cboCCN.DisplayMember = MST_CCNTable.CODE_FLD;
			cboCCN.ValueMember = MST_CCNTable.CCNID_FLD;
			FormControlComponents.PutDataIntoC1ComboBox(cboCCN,dstCCN.Tables[MST_CCNTable.TABLE_NAME],MST_CCNTable.CODE_FLD,MST_CCNTable.CCNID_FLD,MST_CCNTable.TABLE_NAME);
			if (SystemProperty.CCNID != 0)
				cboCCN.SelectedValue = SystemProperty.CCNID;
		}

		private void CreateTableForGrid(int intType)
		{
			dstBOMDetail = new DataSet();
			if (intType == 1)
			{
				dstBOMDetail.Tables.Add(PRO_WOBOMTable.TABLE_NAME);
				//WOBOM table
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(CaptionLine);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.WOBOMID_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.PRODUCTID_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.COMPONENTID_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.CODE_FLD);

				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.DESCRIPTION_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.REVISION_FLD);
					
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(WorkCenterCode);
			
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(StockUMCode);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(ITM_ProductTable.STOCKUMID_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.QUANTITY_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.ROUTINGID_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(CaptionOperation);

				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.LEADTIMEOFFSET_FLD);
				dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns.Add(PRO_WOBOMTable.SHRINK_FLD);

			}			
		}

		private bool GetDataFormGrid()
		{
			int intDeleteBefore =0;
			for (int j =0; j <dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows.Count; j++)
			{
				if (dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Deleted)
				{
					intDeleteBefore++;
				}
				else if ((dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Modified) || (dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j].RowState == DataRowState.Added))
				{
					dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.PRODUCTID_FLD] = voProduct.ProductID;
					dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.WORKORDERDETAILID_FLD] = (int)txtFGoodsCode.Tag;
					dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.WORKORDERMASTERID_FLD] = (int)txtWOMaster.Tag;
					dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.COMPONENTID_FLD]= dgrdData[j-intDeleteBefore, PRO_WOBOMTable.COMPONENTID_FLD].ToString().Trim();
					if (dgrdData[j - intDeleteBefore, PRO_WOBOMTable.ROUTINGID_FLD].ToString() != string.Empty)
					{
						try
						{
							dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.ROUTINGID_FLD] = dgrdData.Columns[ PRO_WOBOMTable.ROUTINGID_FLD].CellValue(j-intDeleteBefore);
						}
						catch
						{
							dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows[j][PRO_WOBOMTable.ROUTINGID_FLD] = DBNull.Value;
						}
					}
				}
			}

			return true;
		}

		private void ConfigGridLayout()
		{
			//invisible columns
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.WOBOMID_FLD].Visible = false;
			dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.PRODUCTID_FLD].Visible = false;
			dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.STOCKUMID_FLD].Visible = false;
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.COMPONENTID_FLD].Visible = false;
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.ROUTINGID_FLD].Visible = false;

			//lock columns
			dgrdData.Splits[0].DisplayColumns[CaptionLine].Locked = true;
			dgrdData.Splits[0].DisplayColumns[ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD].Locked = true;
			dgrdData.Splits[0].DisplayColumns[MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD].Locked = true;
			dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.REVISION_FLD].Locked  = true;
			dgrdData.Splits[0].DisplayColumns[StockUMCode].Locked = false;
			dgrdData.Splits[0].DisplayColumns[WorkCenterCode].Locked = false;
	
			//set new properties for columns
			dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD].Button = true;
			dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.DESCRIPTION_FLD].Button = true;
			dgrdData.Splits[0].DisplayColumns[StockUMCode].Button = true;

			//set width for column
			dgrdData.Splits[0].DisplayColumns[CaptionLine].Style.HorizontalAlignment = AlignHorzEnum.Far;
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.QUANTITY_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.LEADTIMEOFFSET_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;
			dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.SHRINK_FLD].Style.HorizontalAlignment = AlignHorzEnum.Far;

			dgrdData.Columns[PRO_WOBOMTable.LEADTIMEOFFSET_FLD].NumberFormat = Constants.INTERGER_NUMBERFORMAT;
			dgrdData.Columns[PRO_WOBOMTable.QUANTITY_FLD].NumberFormat = DECIMAL_NUMBERFORMAT_SMALL;
			dgrdData.Columns[PRO_WOBOMTable.SHRINK_FLD].NumberFormat = DECIMAL_NUMBERFORMAT_SMALL;
				
			dgrdData.Splits[0].DisplayColumns[CaptionOperation].Button = true;
			for (int i =0; i < dgrdData.Splits[0].DisplayColumns.Count; i++)
				dgrdData.Splits[0].DisplayColumns[i].HeadingStyle.HorizontalAlignment = AlignHorzEnum.Center;
		}

		private void DisableGrid(bool blnSate)
		{
			for (int i =0; i <dgrdData.Splits[0].DisplayColumns.Count; i++)
				dgrdData.Splits[0].DisplayColumns[i].Locked = blnSate;
		}

		private void EnableDisableButton(EnumAction enumAction)
		{
			if (enumAction == EnumAction.Default)
			{
				txtBOMDes.Enabled = false;
				txtIncrement.Enabled = false;
				DisableGrid(true);
				btnSave.Enabled = false;
				btnEdit.Enabled = false;
				btnDelete.Enabled = false;
				dgrdData.AllowDelete = false;
			}
			if (enumAction == EnumAction.Add)
			{
				DisableGrid(false);
				btnSave.Enabled		= true;
				txtBOMDes.Enabled	= true;
				txtIncrement.Enabled = true;
				btnEdit.Enabled = false;
				btnDelete.Enabled = false;
				dgrdData.AllowDelete = true;
			}
			if (enumAction == EnumAction.Edit)
			{
				DisableGrid(false);
				btnSave.Enabled		= true;
				btnDelete.Enabled = false;
				txtBOMDes.Enabled	= true;
				txtIncrement.Enabled	= true;
				dgrdData.AllowDelete = true;
			}
		}

		private void BindDataFromSearchFormToGrid(int pintProductID)
		{
			if (pintProductID != 0)
			{
				ITM_Product voComponent = new ITM_Product();
				MST_UnitOfMeasure voUM = new MST_UnitOfMeasure();
					
				voComponent = new ProductItemInfoBO().GetProductInfo(pintProductID);
                int iDesignUMID = voComponent.DesignUMID ?? 0;
				voUM = new UtilsBO().GetUnitOfMeasure(iDesignUMID);
					
				dgrdData.EditActive = true;
				dgrdData[dgrdData.Row, ITM_ProductTable.CODE_FLD] = voComponent.Code;
				dgrdData.Columns[ITM_ProductTable.CODE_FLD].Tag = voComponent.Code;
				dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = voComponent.Description;
				dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = voComponent.Revision;
				dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = voComponent.Revision;
				dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD] = pintProductID;
                int iWorkCenterID = voComponent.WorkCenterID ?? 0;
                dgrdData[dgrdData.Row, WorkCenterCode] = boWOBOM.GetWorkCenterInfo(iWorkCenterID);
				dgrdData[dgrdData.Row, StockUMCode] = voUM.Code;
				dgrdData[dgrdData.Row, PRO_WOBOMTable.BOMUMID_FLD] = voUM.UnitOfMeasureID;

				//get CategoryCode
                int iCategoryID = voComponent.CategoryID ?? 0;
                try
                {
                    ITM_Category voCategory = new ITM_CategoryBO().GetCategory(iCategoryID);
                    dgrdData[dgrdData.Row, ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD] = voCategory.Code;
                }
                catch
                { }
				

				//get PartyCode
                try
                {
                    MST_Party voParty = new PartyBO().GetParty(voComponent.PrimaryVendorID, string.Empty);
                    dgrdData[dgrdData.Row, MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD] = voParty.Code;
                }
                catch
                { }

				int intIncrement = 0;
				if (dgrdData[dgrdData.Row, CaptionLine].ToString() == string.Empty)
				{
					if (txtIncrement.Value.ToString() != string.Empty)
						intIncrement = int.Parse(txtIncrement.Value.ToString());
					if ((dgrdData.Row == 0) && (intIncrement >0))
						dgrdData[dgrdData.Row, CaptionLine] = intIncrement.ToString();
					else if ((dgrdData.Row == 0) && (intIncrement ==0))
						dgrdData[dgrdData.Row, CaptionLine] = 1;
					else
					{
						try
						{
							if (intIncrement != 0)
								dgrdData.Columns[CaptionLine].Value = int.Parse(dgrdData[dgrdData.Row -1, CaptionLine].ToString()) + intIncrement;
							else
								dgrdData.Columns[CaptionLine].Value = int.Parse(dgrdData[dgrdData.Row -1, CaptionLine].ToString()) + 1;
						}
						catch
						{
							dgrdData[dgrdData.Row, CaptionLine] = dgrdData.Row + 1;
						}						
					}
				}
			}
			else
			{
				dgrdData[dgrdData.Row, ITM_ProductTable.CODE_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, ITM_ProductTable.DESCRIPTION_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, ITM_ProductTable.REVISION_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, StockUMCode] = DBNull.Value;
				dgrdData[dgrdData.Row, PRO_WOBOMTable.BOMUMID_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, WorkCenterCode] = DBNull.Value;
				dgrdData[dgrdData.Row, ITM_CategoryTable.TABLE_NAME + ITM_CategoryTable.CODE_FLD] = DBNull.Value;
				dgrdData[dgrdData.Row, MST_PartyTable.TABLE_NAME + MST_PartyTable.CODE_FLD] = DBNull.Value;
			}
		}

		private bool ValidateData()
		{
			//requires
			if (FormControlComponents.CheckMandatory(txtItemCode))
			{
				PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID);
				txtItemCode.Focus();
				txtItemCode.Select();
				return false;
			}

			if (txtIncrement.Value.ToString().Trim() != string.Empty)
			{
				if (!FormControlComponents.IsNumeric(txtIncrement.Value.ToString()))
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC);
					txtIncrement.Focus();
					txtIncrement.Select();
					return false;
				}
				else
				{
					voProduct.BomIncrement = int.Parse(txtIncrement.Value.ToString().Trim());
					if ((voProduct.BomIncrement > 255) || (voProduct.BomIncrement <0))
						PCSMessageBox.Show(ErrorCode.MESSAGE_INVALID_NUMERIC);
				}
			}
            for (int i = 0; i < dgrdData.RowCount; i++)
            {
                //check all component
                if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD]);
                    dgrdData.Focus();
                    return false;
                }
                if (dgrdData[i, PRO_WOBOMTable.QUANTITY_FLD].ToString().Trim() == string.Empty)
                {
                    PCSMessageBox.Show(ErrorCode.MANDATORY_INVALID, MessageBoxIcon.Warning);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.QUANTITY_FLD]);
                    dgrdData.Focus();
                    return false;
                }
                //check shrink
                try
                {
                    if (dgrdData[i, PRO_WOBOMTable.SHRINK_FLD].ToString().Trim() != string.Empty)
                    {
                        float intShrink = float.Parse(dgrdData[i, PRO_WOBOMTable.SHRINK_FLD].ToString().Trim());
                        if ((intShrink < 0) && (intShrink > 100))
                        {
                            PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK);
                            dgrdData.Row = i;
                            dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.SHRINK_FLD]);
                            dgrdData.Focus();
                            return false;
                        }
                    }
                }
                catch
                {
                    PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK);
                    dgrdData.Row = i;
                    dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.SHRINK_FLD]);
                    dgrdData.Focus();
                    return false;
                }
                for (int j = i + 1; j < dgrdData.RowCount; j++)
                {
                    try
                    {
                        if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() != string.Empty && dgrdData[j, ITM_ProductTable.CODE_FLD].ToString() != string.Empty)
                        {
                            if (dgrdData[i, ITM_ProductTable.CODE_FLD].ToString() == dgrdData[j, ITM_ProductTable.CODE_FLD].ToString())
                            {
                                MessageBox.Show("Mã VT bị trùng", "Question", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                dgrdData.Row = j;
                                dgrdData.Col = dgrdData.Splits[0].DisplayColumns.IndexOf(dgrdData.Splits[0].DisplayColumns[ITM_ProductTable.CODE_FLD]);
                                dgrdData.Focus();
                                return false;
                            }
                        }
                    }
                    catch
                    {
                    }
                }
            }

			if (dgrdData.RowCount < 1)
			{
				throw new PCSException(ErrorCode.MESSAGE_BOM_EXISTATLISTROW, string.Empty, null);
			}
			return true;
		}
			
		private void Bom_Load(object sender, System.EventArgs e)
		{
			
			string METHOD_NAME = THIS + ".Bom_Load()";
			try
			{
				Security objSecurity = new Security();
				this.Name = THIS;
				if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					this.Close();
					return;
				}

				LoadComboCCN();
				
				dtbGridLayout = FormControlComponents.StoreGridLayout(dgrdData);
				txtIncrement.Tag = OleDbType.TinyInt;
				
				DataRow drowProductInfo = boWOBOM.GetInfoForWOBom(voProduct.ProductID);
				if (drowProductInfo == null)
				{
					this.Close();
					return;
				}
				voProduct.Code = drowProductInfo[ITM_ProductTable.CODE_FLD].ToString();
				voProduct.Revision = drowProductInfo[ITM_ProductTable.REVISION_FLD].ToString();
				voProduct.Description = drowProductInfo[ITM_ProductTable.DESCRIPTION_FLD].ToString();
				voProduct.BOMDescription = drowProductInfo[ITM_ProductTable.BOMDESCRIPTION_FLD].ToString();
				voProduct.CCNID = Convert.ToInt32(drowProductInfo[ITM_ProductTable.CCNID_FLD]);
				txtItemCode.Text = voProduct.Code;
				txtModel.Text = voProduct.Revision;
				txtPartName.Text = voProduct.Description;
				txtBOMDes.Text = voProduct.BOMDescription ;
				txtWorkCenter.Text = drowProductInfo[MST_WorkCenterTable.TABLE_NAME + MST_WorkCenterTable.CODE_FLD].ToString();
				cboCCN.SelectedValue = voProduct.CCNID;
				if (voProduct.BomIncrement != 0)
				{
				    txtIncrement.Value = drowProductInfo[ITM_ProductTable.BOMINCREMENT_FLD].ToString();
				}
				CreateTableForGrid(2);
				LoadDataSource();

			    FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
				ConfigGridLayout();

				if (intWOLineStatus == (int)WOLineStatus.Unreleased)
				{
					if (dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Rows.Count == 0)
					{
						enumAction = EnumAction.Add;
						txtIncrement.Value = 1;
						DisableGrid(false);
						btnSave.Enabled = true;
						txtBOMDes.Text = string.Empty;
						txtIncrement.Enabled = true;
						txtBOMDes.Enabled = true;
						dgrdData.AllowDelete = true;
						dgrdData.AllowAddNew = true;
					}
					else
					{
						DisableGrid(true);
						btnDelete.Enabled = true;
						btnEdit.Enabled = true;
						btnSave.Enabled = false;
						txtBOMDes.Enabled = false;
						txtIncrement.Enabled = false;
					}
				}
				else
				{
					DisableGrid(true);
					btnSave.Enabled = false;
					btnDelete.Enabled = false;
					btnEdit.Enabled = false;
					dgrdData.AllowAddNew = false;
				}
				if (blnIsChange)
				{
					DisableGrid(false);
					enumAction = EnumAction.Edit;
					btnSave.Enabled = true;
					btnDelete.Enabled = false;
					btnEdit.Enabled = false;
					dgrdData.AllowAddNew = true;
					dgrdData.AllowDelete = false;
				}

                txtFGoodsCode.Focus();
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

	    private void LoadDataSource()
	    {
	        int workOrderDetailId = Convert.ToInt32(txtFGoodsCode.Tag);
            dstBOMDetail.Tables.Add(boWOBOM.ListBOMDetailsOfProduct(voProduct.ProductID, workOrderDetailId).Copy());
	        dgrdData.DataSource = dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME];
	        dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns[PRO_WOBOMTable.WORKORDERDETAILID_FLD].DefaultValue = workOrderDetailId;
	        dstBOMDetail.Tables[PRO_WOBOMTable.TABLE_NAME].Columns[PRO_WOBOMTable.WORKORDERMASTERID_FLD].DefaultValue = Convert.ToInt32(txtWOMaster.Tag);
	    }

	    private void Bom_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			if (e.KeyCode == Keys.F12)
			{
				if (btnSave.Enabled)
				{
					dgrdData.Row = dgrdData.RowCount;
					dgrdData.Col = dgrdData.Columns.IndexOf(dgrdData.Columns[ITM_ProductTable.CODE_FLD]);
					dgrdData.Focus();
				}
			}
		}

		private void Bom_Closing(object sender, System.ComponentModel.CancelEventArgs e)
		{
            const string METHOD_NAME = THIS + ".Bom_Closing()";
			try
			{
				if ((enumAction == EnumAction.Add)||(enumAction == EnumAction.Edit))
				{
					DialogResult confirmDialog = PCSMessageBox.Show(ErrorCode.MESSAGE_QUESTION_STORE_INTO_DATABASE, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
					switch (confirmDialog)
					{
						case DialogResult.Yes:
							//Save before exit
							btnSave_Click(btnSave, new EventArgs());
							if (blnHasError)
							{
								e.Cancel = true;
							}
							break;
						case DialogResult.No:
							break;
						case DialogResult.Cancel:
							e.Cancel = true;
							break;
					}
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void btnSave_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnSave_Click()";
			blnHasError = true;
			try
			{
				if (!dgrdData.EditActive && ValidateData())
				{
					if (!GetDataFormGrid()) return;
					voProduct.BOMDescription = txtBOMDes.Text.Trim();
					boWOBOM.UpdateAll(dstBOMDetail);
					CreateTableForGrid(2);
				    LoadDataSource();
					ConfigGridLayout();
					FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
					PCSMessageBox.Show(ErrorCode.MESSAGE_AFTER_SAVE_DATA);
					blnHasError = false;
					btnSave.Enabled = false;
					DisableGrid(true);
					btnEdit.Enabled = true;
					btnDelete.Enabled = true;
					dgrdData.AllowDelete = false;
					enumAction = EnumAction.Default;
					txtBOMDes.Enabled = false;
					txtIncrement.Enabled = false;
				}
			}
			catch (PCSException ex)
			{
				if (ex.mCode == ErrorCode.DUPLICATE_KEY)
				{
					PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_DUPLICATECOMPONENT, MessageBoxIcon.Error);
				}
				else
				{
					PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				}
				if (ex.CauseException != null)
				{
					try
					{
						Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
					}
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void btnDelete_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnDelete_Click()";
			try
			{
				if (dgrdData.EditActive) return;
				DataSet dstDelete = new DataSet();
				dstDelete.Tables.Add(boWOBOM.ListBOMDetailsOfProduct(voProduct.ProductID,int.Parse(txtFGoodsCode.Tag.ToString())).Copy());
				if (PCSMessageBox.Show(ErrorCode.MESSAGE_DELETE_RECORD, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
				{
					foreach (DataRow drow in dstDelete.Tables[PRO_WOBOMTable.TABLE_NAME].Rows)
						drow.Delete();
					voProduct.BOMDescription = string.Empty;
					voProduct.BomIncrement = 0;
					boWOBOM.UpdateAll(dstDelete);
					dgrdData.DataSource = dstDelete.Tables[0];
					FormControlComponents.RestoreGridLayout(dgrdData, dtbGridLayout);
					ConfigGridLayout();
					//ResetForm();
					enumAction = EnumAction.Default;
					EnableDisableButton(enumAction);
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void btnEdit_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnEdit_Click()";
			try
			{
				enumAction = EnumAction.Edit;
				EnableDisableButton(enumAction);
				txtIncrement.Focus();
				btnEdit.Enabled = false;
				ConfigGridLayout();
			}
			catch (PCSException ex)
			{
				throw new PCSException(ex.mCode, METHOD_NAME, ex);
			}
			catch (Exception ex)
			{
				throw new Exception(ex.Message, ex);
			}
		}

		private void btnOK_Click(object sender, System.EventArgs e)
		{
			this.Close();
		}

		private void cboCCN_TextChanged(object sender, System.EventArgs e)
		{
			ResetForm();
			EnableDisableButton(enumAction);
		}

		private void dgrdData_BeforeColUpdate(object sender, C1.Win.C1TrueDBGrid.BeforeColUpdateEventArgs e)
		{
			const string METHOD_NAME = THIS + ".dgrdData_BeforeColUpdate()";
			try
			{
				Hashtable htbCriteria = new Hashtable();
				DataRowView drwResult = null;
				if (e.Column.DataColumn.Text.Trim()	 == string.Empty) return;
				if (e.Column.DataColumn.DataField == ITM_ProductTable.CODE_FLD || e.Column.DataColumn.DataField == ITM_ProductTable.DESCRIPTION_FLD)
				{
					if (cboCCN.SelectedIndex >= 0)
						htbCriteria.Add(MST_CCNTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
					else
						htbCriteria.Add(MST_CCNTable.CCNID_FLD, 0);
					drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, e.Column.DataColumn.DataField, dgrdData.Columns[e.Column.DataColumn.DataField].Text.Trim(), htbCriteria, false);
					if (drwResult != null)
						e.Column.DataColumn.Tag = drwResult.Row;
					else
						e.Cancel = true;
				}
				if (e.Column.DataColumn.DataField == CaptionOperation)
				{
					htbCriteria = new Hashtable();
					htbCriteria.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
					drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData.Columns[e.Column.DataColumn.DataField].Text.Trim(), htbCriteria, false);
					if (drwResult != null)
					{
						dgrdData.Columns[ITM_RoutingTable.ROUTINGID_FLD].Value = int.Parse(drwResult[ITM_RoutingTable.ROUTINGID_FLD].ToString());
						dgrdData.Columns[CaptionOperation].Value = drwResult[ITM_RoutingTable.STEP_FLD];
						e.Column.DataColumn.Tag = drwResult.Row;
					}
					else
						e.Cancel = true;
				}
				//check quantity
				if (dgrdData.Splits[0].DisplayColumns[dgrdData.Col].DataColumn.DataField == PRO_WOBOMTable.QUANTITY_FLD)
				{
					try
					{
						float fQuantity = float.Parse(dgrdData.Splits[0].DisplayColumns[PRO_WOBOMTable.QUANTITY_FLD].DataColumn.Value.ToString().Trim());
						if (fQuantity <= 0.0)
						{
							PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_QUANTITY, MessageBoxIcon.Error);
							e.Cancel = true;
							return;
						}
					}
					catch
					{
						//cancel update and throw PCSException
						e.Cancel = true;
						PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_QUANTITY, MessageBoxIcon.Error);
						return;
					}
				}
				//check shrink
				if (e.Column.DataColumn.DataField == PRO_WOBOMTable.SHRINK_FLD)
				{
					try
					{
						if (e.Column.DataColumn.Value.ToString() != string.Empty)
						{
							decimal intShrink = decimal.Parse(e.Column.DataColumn.Value.ToString());
							if ((intShrink < 0) || (intShrink > 99))
							{
								PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK, MessageBoxIcon.Error);
								e.Cancel = true;
								return;
							}
						}
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.MESSAGE_BOM_SHRINK, MessageBoxIcon.Error);
						e.Cancel = true;
						return;
					}
				}

				//check lead time offset
				if (e.Column.DataColumn.DataField == PRO_WOBOMTable.LEADTIMEOFFSET_FLD)
				{
					try
					{
						if (e.Column.DataColumn.Value.ToString() != string.Empty)
						{
							decimal intLeadTime = decimal.Parse(e.Column.DataColumn.Value.ToString());
							if (intLeadTime <= 0)
							{
								PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
								e.Cancel = true;
								return;
							}
						}
					}
					catch
					{
						PCSMessageBox.Show(ErrorCode.MSG_LABORTIME_QTY, MessageBoxIcon.Error);
						e.Cancel = true;
						return;
					}
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				e.Cancel = true;
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				return;
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				e.Cancel = true;
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				return;
			}
		}
		private void dgrdData_ButtonClick(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
		{
			const string METHOD_NAME = THIS + ".dgrdData_ButtonClick()";
			try
			{
				if (blnIsChange)
				{
					// unable to change component in use of : Required Material, WO Completion and PRO Issue
					if (dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD] != null && dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD].ToString() != string.Empty)
					{
						bool blnIsEditable = boWOBOM.IsEditable(Convert.ToInt32(dgrdData[dgrdData.Row, PRO_WOBOMTable.WORKORDERDETAILID_FLD]),
							Convert.ToInt32(dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD]));
						if (!blnIsEditable)
							return;
					}
				}
				string strColName = dgrdData.Splits[0].DisplayColumns[dgrdData.Col].DataColumn.DataField;
				Hashtable htbCondition = new Hashtable();
				if (!btnSave.Enabled) return;
				DataRowView drwResult = null;
				if ((strColName == ITM_ProductTable.CODE_FLD) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
				{
					if (cboCCN.SelectedValue != null)
						htbCondition.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
					else
						htbCondition.Add(ITM_ProductTable.CCNID_FLD, 0);
					if (dgrdData.AddNewMode == AddNewModeEnum.AddNewCurrent)
						drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
					else
						drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.CODE_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
					if (drwResult != null)
						BindDataFromSearchFormToGrid(int.Parse(drwResult[ITM_ProductTable.PRODUCTID_FLD].ToString()));
				}
				if ((strColName == ITM_ProductTable.DESCRIPTION_FLD) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
				{
					if (cboCCN.SelectedValue != null)
						htbCondition.Add(ITM_ProductTable.CCNID_FLD, cboCCN.SelectedValue.ToString());
					else
						htbCondition.Add(ITM_ProductTable.CCNID_FLD, 0);
					if (dgrdData.AddNewMode == AddNewModeEnum.AddNewCurrent)
						drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.DESCRIPTION_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
					else
						drwResult = FormControlComponents.OpenSearchForm(v_ITMBOM_Product.VIEW_NAME, ITM_ProductTable.DESCRIPTION_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
					if (drwResult != null)
						BindDataFromSearchFormToGrid(int.Parse(drwResult[ITM_ProductTable.PRODUCTID_FLD].ToString()));
				}
				if (strColName == CaptionOperation)
				{
					htbCondition = new Hashtable();
					htbCondition.Add(ITM_ProductTable.PRODUCTID_FLD, voProduct.ProductID);
					if (dgrdData.AddNewMode != AddNewModeEnum.NoAddNew)
						drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
					else
						drwResult = FormControlComponents.OpenSearchForm(ITM_RoutingTable.TABLE_NAME, ITM_RoutingTable.STEP_FLD, dgrdData.Columns[strColName].Text.Trim(), htbCondition, true);
					if (drwResult != null)
					{
						dgrdData.Columns[PRO_WOBOMTable.ROUTINGID_FLD].Value = drwResult[ITM_RoutingTable.ROUTINGID_FLD];
						dgrdData.Columns[CaptionOperation].Value = drwResult[ITM_RoutingTable.STEP_FLD].ToString();
					}
				}
				if ((strColName == ITM_ProductTable.STOCK_FLD.Trim() + MST_UnitOfMeasureTable.CODE_FLD.Trim() ) && (!dgrdData.Splits[0].DisplayColumns[strColName].Locked))
				{
					drwResult = FormControlComponents.OpenSearchForm(MST_UnitOfMeasureTable.TABLE_NAME, MST_UnitOfMeasureTable.CODE_FLD, dgrdData[dgrdData.Row, strColName].ToString(), htbCondition, true);
					
					if (drwResult != null)
					{
						dgrdData[dgrdData.Row, StockUMCode] = drwResult[MST_UnitOfMeasureTable.CODE_FLD];
						dgrdData[dgrdData.Row, PRO_WOBOMTable.BOMUMID_FLD] = drwResult[MST_UnitOfMeasureTable.UNITOFMEASUREID_FLD];
					}
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void dgrdData_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
		{
			switch (e.KeyCode)
			{
				case Keys.F4:
					if (btnSave.Enabled)
					{
						dgrdData_ButtonClick(sender, null);
					}
					break;
				
			}
		}

		private void dgrdData_AfterColUpdate(object sender, C1.Win.C1TrueDBGrid.ColEventArgs e)
		{
			const string METHOD_NAME = THIS + ".dgrdData_AfterColUpdate()";
			try
			{
				string ColName = e.Column.DataColumn.DataField;
				if (ColName == ITM_ProductTable.CODE_FLD || ColName == ITM_ProductTable.DESCRIPTION_FLD)
				{
					if (e.Column.DataColumn.Value.ToString() != string.Empty)
						BindDataFromSearchFormToGrid(int.Parse(((DataRow) e.Column.DataColumn.Tag)[ITM_ProductTable.PRODUCTID_FLD].ToString()));
					else
						BindDataFromSearchFormToGrid(0);
				}
				if (ColName == CaptionOperation)
				{
					if (e.Column.DataColumn.Value.ToString() != string.Empty)
					{
						dgrdData.Columns[PRO_WOBOMTable.ROUTINGID_FLD].Value = ((DataRow) e.Column.DataColumn.Tag)[ITM_RoutingTable.ROUTINGID_FLD];
						dgrdData.Columns[CaptionOperation].Value = ((DataRow) e.Column.DataColumn.Tag)[ITM_RoutingTable.STEP_FLD].ToString();
					}
					else
					{
						dgrdData.Columns[PRO_WOBOMTable.ROUTINGID_FLD].Value = DBNull.Value;
						dgrdData.Columns[CaptionOperation].Value = DBNull.Value;
					}
				}
				int intIncrement = 0;
				if (dgrdData[dgrdData.Row, CaptionLine].ToString() == string.Empty)
				{
					if (txtIncrement.Value.ToString() != string.Empty)
						intIncrement = int.Parse(txtIncrement.Value.ToString());
					if ((dgrdData.Row == 0) && (intIncrement >0))
						dgrdData[dgrdData.Row, CaptionLine] = intIncrement;
					else if ((dgrdData.Row == 0) && (intIncrement ==0))
						dgrdData[dgrdData.Row, CaptionLine] = 1;
					else
					{
						if (intIncrement != 0)
							dgrdData[dgrdData.Row, CaptionLine] = int.Parse(dgrdData[dgrdData.Row -1, CaptionLine].ToString()) + intIncrement;
						else
							dgrdData[dgrdData.Row, CaptionLine] = int.Parse(dgrdData[dgrdData.Row -1, CaptionLine].ToString()) + 1;
					}
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void dgrdData_BeforeColEdit(object sender, BeforeColEditEventArgs e)
		{
			const string METHOD_NAME = THIS + ".dgrdData_BeforeColEdit()";
			try
			{
				if (blnIsChange)
				{
					// unable to change component in use of : Required Material, WO Completion and PRO Issue
					if (dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD] != null && dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD].ToString() != string.Empty)
					{
						bool blnIsEditable = boWOBOM.IsEditable(Convert.ToInt32(dgrdData[dgrdData.Row, PRO_WOBOMTable.WORKORDERDETAILID_FLD]),
							Convert.ToInt32(dgrdData[dgrdData.Row, PRO_WOBOMTable.COMPONENTID_FLD]));
						if (!blnIsEditable)
							e.Cancel = true;
					}
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				e.Cancel = true;
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				return;
			}
			catch (Exception ex)
			{
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				e.Cancel = true;
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
				return;
			}
		}
	}
}
